Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break requirements down on per backend basis #64

Merged
merged 8 commits into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ language: python
python:
- "3.7"
install:
- pip install -e .
- pip install -r requirements.txt
- pip install -r requirements-optional.txt
- pip install -e .[all]
- docker pull quen2404/openapi-diff
script:
- py.test --cov=optimade
Expand Down
10 changes: 8 additions & 2 deletions optimade/filtertransformers/tests/test_django.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import json
from optimade.filtertransformers.django import Lark2Django
from unittest import TestCase
try:
from optimade.filtertransformers.django import Lark2Django
DJANGO_NOT_IMPORTED = False
except ImportError:
DJANGO_NOT_IMPORTED = True

from unittest import TestCase, skipIf
import os

test_data = [
Expand All @@ -17,6 +22,7 @@
]


@skipIf(DJANGO_NOT_IMPORTED, 'Django not found')
class DjangoParserTest(TestCase):
@classmethod
def setUpClass(cls):
Expand Down
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# To pin testing and deployments to specific versions
fastapi[all]==0.28.0
lark-parser==0.5.6
mongogrant==0.2.2
mongomock==3.16.0
mongomock==3.16
pymongo==3.8.0
django==2.2.5
File renamed without changes.
1 change: 1 addition & 0 deletions requirements/django_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
django==2.2.5
1 change: 1 addition & 0 deletions requirements/mongo_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mongogrant==0.2.2
32 changes: 24 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
import os
import glob

from setuptools import setup, find_packages

module_dir = os.path.dirname(os.path.abspath(__file__))

with open("requirements.txt") as f:
requirements = [
line.strip()
for line in f.readlines()
if line and not line.strip().startswith("#")
]

extra_requirements = {}
for fname in glob.glob("requirements/*_requirements.txt"):
req = os.path.basename(fname).split("_")[0]
with open(fname, "r") as f:
extra_requirements[req] = [
line.strip()
for line in f.readlines()
if line and not line.strip().startswith("#")
]

extra_requirements["all"] = [
req for key in extra_requirements for req in extra_requirements[key]
]

setup(
name="optimade",
version="0.2.0",
Expand All @@ -16,14 +38,8 @@
description="Tools for implementing and consuming OPTiMaDe APIs.",
long_description=open(os.path.join(module_dir, "README.md")).read(),
long_description_content_type="text/markdown",
install_requires=[
"pymongo>=3.8",
"lark-parser>=0.5.6",
"mongogrant",
"mongomock>=3.16",
"fastapi[all]",
],
extras_require={"dev": ["black", "invoke", "pre-commit", "twine"]},
install_requires=requirements,
extras_require=extra_requirements,
tests_require=["pytest>=3.6", "openapi-spec-validator", "jsondiff"],
classifiers=[
"Development Status :: 3 - Alpha",
Expand Down