Skip to content

Commit

Permalink
Modified: Split requirements.txt into prod, dev and docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Caparrini committed Feb 21, 2024
1 parent c1fa8ed commit 6118538
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 35 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
with:
python-version: '3.8'
- name: Install dependencies
run: pip install -r requirements.txt
run: pip install -r requirements_prod.txt
- name: Install pytest and pytest-cov
run: pip install pytest pytest-cov
- name: Run tests and collect coverage
run: pytest --cov mloptimizer
- name: Upload coverage to Codecov
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
python-version: '3.8'
- name: Install dependencies
run: pip install -r requirements.txt
run: pip install -r requirements_dev.txt
- name: 'Qodana Scan'
uses: JetBrains/[email protected]
env:
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sphinx:
python:
# Install our python package before building the docs
install:
- requirements: requirements.txt
- requirements: requirements_docs.txt

formats:
- pdf
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ WORKDIR /mloptimizer

# By copying over requirements first, we make sure that Docker will cache
# our installed requirements rather than reinstall them on every build
COPY requirements.txt /mloptimizer/requirements.txt
RUN pip install -r requirements.txt
COPY requirements_prod.txt /mloptimizer/requirements_prod.txt
RUN pip install -r requirements_prod.txt
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
sys.path.insert(0, os.path.abspath('..'))

project = 'mloptimizer'
copyright = '2023, Antonio Caparrini'
copyright = '2024, Antonio Caparrini'

Check notice on line 15 in docs/conf.py

View workflow job for this annotation

GitHub Actions / Qodana Community for Python

Shadowing built-in names

Shadows built-in name 'copyright'
author = 'Antonio Caparrini'
release = '0.6.0'
release = '0.6.1'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
File renamed without changes.
20 changes: 20 additions & 0 deletions requirements_docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
catboost>=1.1.1
deap>=1.3.3
joblib>=1.2.0
keras==2.12.0
pandas>=1.5.3
python-dateutil>=2.8.1
pytz>=2022.7.1
scikit-learn>=1.2.1
scipy>=1.10.0
seaborn==0.12.2
six>=1.15.0
tensorflow>=2.12.0
xgboost>=1.7.3
plotly>=5.15.0
pytest-cov
kaleido
sphinx-gallery==0.14.0
sphinx_book_theme
sphinx_mdinclude
sphinx-autoapi
15 changes: 15 additions & 0 deletions requirements_prod.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
catboost>=1.1.1
deap>=1.3.3
joblib>=1.2.0
keras==2.12.0
pandas>=1.5.3
python-dateutil>=2.8.1
pytz>=2022.7.1
scikit-learn>=1.2.1
scipy>=1.10.0
seaborn==0.12.2
six>=1.15.0
tensorflow>=2.12.0
xgboost>=1.7.3
plotly>=5.15.0
kaleido
41 changes: 13 additions & 28 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
here = pathlib.Path(__file__).parent.resolve()
long_description = (here / "README.md").read_text(encoding="utf-8")


def read_requirements(requirements_file):
with open(requirements_file) as f:
return f.read().splitlines()


setup(
# This is the name of your project. The first time you publish this
# package, this name will be registered for you. It will determine how
Expand All @@ -24,7 +30,7 @@
# For a discussion on single-sourcing the version across setup.py and the
# project code, see
# https://packaging.python.org/guides/single-sourcing-package-version/
version="0.6.0", # Required
version="0.6.1", # Required
# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:
# https://packaging.python.org/specifications/core-metadata/#summary
Expand Down Expand Up @@ -111,29 +117,8 @@
#
# For an analysis of "install_requires" vs pip's requirements files see:
# https://packaging.python.org/discussions/install-requires-vs-requirements/
install_requires=[
"catboost>=1.1.1",
"deap>=1.3.3",
"joblib>=1.2.0",
"keras==2.12.0",
# "numpy>=1.24.1",
"pandas>=1.5.3",
"python-dateutil>=2.8.1",
"pytz>=2022.7.1",
"scikit-learn>=1.2.1",
"scipy>=1.10.0",
"seaborn==0.12.2",
"six>=1.15.0",
"tensorflow>=2.12.0",
"xgboost>=1.7.3",
# "matplotlib~=3.7.1",
"plotly>=5.15.0",
"sphinx-gallery==0.14.0",
"sphinx_book_theme",
"kaleido",
"sphinx_mdinclude",
"sphinx-autoapi"
], # Optional
install_requires=read_requirements("requirements_prod.txt"),
# Optional
# List additional groups of dependencies here (e.g. development
# dependencies). Users will be able to install these using the "extras"
# syntax, for example:
Expand All @@ -142,10 +127,10 @@
#
# Similar to `install_requires` above, these must be valid existing
# projects.
# extras_require={ # Optional
# "dev": ["check-manifest"],
# "test": ["coverage"],
# },
extras_require={ # Optional
"dev": read_requirements("requirements_dev.txt"),
"docs": read_requirements("requirements_docs.txt"),
},
# If there are data files included in your packages that need to be
# installed, specify them here.
# package_data={ # Optional
Expand Down

0 comments on commit 6118538

Please sign in to comment.