-
Notifications
You must be signed in to change notification settings - Fork 930
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
Consolidate all requirements #2597
Changes from all commits
23da726
bb78940
e790eb0
181659f
4239c2c
e2cdd7a
ceffb66
4104e68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,4 +36,4 @@ python: | |
path: . | ||
extra_requirements: | ||
- docs | ||
- requirements: test_requirements.txt | ||
- test |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,14 @@ | ||
from codecs import open | ||
from glob import glob | ||
from itertools import chain | ||
from os import path | ||
|
||
from setuptools import setup | ||
|
||
name = "kedro" | ||
here = path.abspath(path.dirname(__file__)) | ||
|
||
# at least 1.3 to be able to use XMLDataSet and pandas integration with fsspec | ||
PANDAS = "pandas~=1.3" | ||
SPARK = "pyspark>=2.2, <4.0" | ||
HDFS = "hdfs>=2.5.8, <3.0" | ||
S3FS = "s3fs>=0.3.0, <0.5" | ||
|
||
# get the dependencies and installs | ||
with open("dependency/requirements.txt", encoding="utf-8") as f: | ||
requires = [x.strip() for x in f if x.strip()] | ||
|
||
template_files = [] | ||
for pattern in ["**/*", "**/.*", "**/.*/**", "**/.*/.**"]: | ||
template_files.extend( | ||
|
@@ -80,7 +71,9 @@ def _collect_requirements(requires): | |
"tensorflow.TensorflowModelDataset": [ | ||
# currently only TensorFlow V2 supported for saving and loading. | ||
# V1 requires HDF5 and serialises differently | ||
"tensorflow~=2.0" | ||
"tensorflow~=2.0; platform_system != 'Darwin' or platform_machine != 'arm64'", | ||
# https://developer.apple.com/metal/tensorflow-plugin/ | ||
"tensorflow-macos~=2.0; platform_system == 'Darwin' and platform_machine == 'arm64'", | ||
] | ||
} | ||
yaml_require = {"yaml.YAMLDataSet": [PANDAS, "PyYAML>=4.2, <7.0"]} | ||
|
@@ -139,10 +132,77 @@ def _collect_requirements(requires): | |
} | ||
|
||
extras_require["all"] = _collect_requirements(extras_require) | ||
extras_require["test"] = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are more or less the same as |
||
"adlfs>=2021.7.1, <=2022.2; python_version == '3.7'", | ||
"adlfs~=2023.1; python_version >= '3.8'", | ||
"bandit>=1.6.2, <2.0", | ||
"behave==1.2.6", | ||
"biopython~=1.73", | ||
"blacken-docs==1.9.2", | ||
"black~=22.0", | ||
"compress-pickle[lz4]~=2.1.0", | ||
"coverage[toml]", | ||
"dask[complete]~=2021.10", # pinned by Snyk to avoid a vulnerability | ||
"delta-spark~=1.2.1", # 1.2.0 has a bug that breaks some of our tests: https://github.com/delta-io/delta/issues/1070 | ||
"dill~=0.3.1", | ||
"filelock>=3.4.0, <4.0", | ||
"gcsfs>=2021.4, <=2023.1; python_version == '3.7'", | ||
"gcsfs>=2023.1, <2023.3; python_version >= '3.8'", | ||
"geopandas>=0.6.0, <1.0", | ||
"hdfs>=2.5.8, <3.0", | ||
"holoviews~=1.13.0", | ||
"import-linter[toml]==1.8.0", | ||
"ipython>=7.31.1, <8.0; python_version < '3.8'", | ||
"ipython~=8.10; python_version >= '3.8'", | ||
"isort~=5.0", | ||
"Jinja2<3.1.0", | ||
"joblib>=0.14", | ||
"jupyterlab_server>=2.11.1, <2.16.0", # 2.16.0 requires importlib_metedata >= 4.8.3 which conflicts with flake8 requirement | ||
"jupyterlab~=3.0, <3.6.0", # 3.6.0 requires jupyterlab_server~=2.19 | ||
"jupyter~=1.0", | ||
"lxml~=4.6", | ||
"matplotlib>=3.0.3, <3.4; python_version < '3.10'", # 3.4.0 breaks holoviews | ||
"matplotlib>=3.5, <3.6; python_version == '3.10'", | ||
"memory_profiler>=0.50.0, <1.0", | ||
"moto==1.3.7; python_version < '3.10'", | ||
"moto==3.0.4; python_version == '3.10'", | ||
"networkx~=2.4", | ||
"opencv-python~=4.5.5.64", | ||
"openpyxl>=3.0.3, <4.0", | ||
"pandas-gbq>=0.12.0, <0.18.0", | ||
"pandas~=1.3 # 1.3 for read_xml/to_xml", | ||
"Pillow~=9.0", | ||
"plotly>=4.8.0, <6.0", | ||
"pre-commit>=2.9.2, <3.0", # The hook `mypy` requires pre-commit version 2.9.2. | ||
"psutil~=5.8", | ||
"pyarrow>=6.0", | ||
"pylint>=2.17.0, <3.0", | ||
"pyproj~=3.0", | ||
"pyspark>=2.2, <4.0", | ||
"pytest-cov~=3.0", | ||
"pytest-mock>=1.7.1, <2.0", | ||
"pytest-xdist[psutil]~=2.2.1", | ||
"pytest~=7.2", | ||
"redis~=4.1", | ||
"requests-mock~=1.6", | ||
"requests~=2.20", | ||
"s3fs>=0.3.0, <0.5", # Needs to be at least 0.3.0 to make use of `cachable` attribute on S3FileSystem. | ||
"scikit-learn~=1.0.2", | ||
"scipy~=1.7.3", | ||
"SQLAlchemy~=1.2", | ||
"tables~=3.6.0; platform_system == 'Windows' and python_version<'3.9'", | ||
"tables~=3.6; platform_system != 'Windows'", | ||
"tensorflow~=2.0; platform_system != 'Darwin' or platform_machine != 'arm64'", | ||
# https://developer.apple.com/metal/tensorflow-plugin/ | ||
"tensorflow-macos~=2.0; platform_system == 'Darwin' and platform_machine == 'arm64'", | ||
"triad>=0.6.7, <1.0", | ||
"trufflehog~=2.1", | ||
"xlsxwriter~=1.0", | ||
] | ||
|
||
setup( | ||
package_data={ | ||
name: ["py.typed", "test_requirements.txt"] + template_files | ||
"kedro": ["py.typed"] + template_files | ||
}, | ||
extras_require=extras_require, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic before was to replace
kedro
with allkedro
dependencies. In a way, something likepip install kedro --dependencies-only
(which doesn't exist I believe).Now I'm just removing kedro, because this is only for our tests and the
behave
environment has the development version of kedro preinstalled already.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I made one improvement: parsing the requirement name so we are only dropping
kedro
and not, say,kedro-datasets
orkedro-airflow
. This was incorrect before.