From c2890646c5ebbed5e4a7f15a59df2331b11b4b91 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Thu, 16 Jun 2022 18:33:24 +0200 Subject: [PATCH 1/4] clean up requirements --- docs/requirements.txt | 5 ----- environment.yml | 5 ----- requirements.txt | 6 ------ setup.py | 28 +++++++++++++++------------- 4 files changed, 15 insertions(+), 29 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 6dd3015..e9f1892 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,15 +1,10 @@ -matplotlib numpy xarray dask netcdf4 -pyyaml gsw scipy pooch -jinja2 -geojson -simplekml bitstring pydata-sphinx-theme sphinx diff --git a/environment.yml b/environment.yml index 17e6bc7..70d3624 100644 --- a/environment.yml +++ b/environment.yml @@ -4,19 +4,14 @@ channels: - defaults dependencies: - python - - matplotlib - numpy - pip - xarray - dask - netcdf4 - - pyyaml - gsw - scipy - jinja2 - - geojson - - simplekml - - webcolors - bitstring - pytest - pooch diff --git a/requirements.txt b/requirements.txt index 80d28a0..9c311ca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,8 @@ -matplotlib numpy xarray dask netcdf4 -pyyaml gsw scipy -jinja2 -geojson -simplekml bitstring -pytest pooch diff --git a/setup.py b/setup.py index 1dcb3ea..8a9b76f 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,15 @@ # Get the version from versioneer __version__ = "0.0.2" +with open("./docs/requirements.txt", "r") as handle: + requirements_doc = [ld.strip() for ld in handle.read().splitlines() if ld.strip()] + +with open("./tests/requirements.txt", "r") as handle: + requirements_dev = [ld.strip() for ld in handle.read().splitlines() if ld.strip()] + +with open("./requirements.txt", "r") as handle: + requirements = [ld.strip() for ld in handle.read().splitlines() if ld.strip()] + setup(name="pyglider", version=__version__, description="Glider data to netCDF translation in python", @@ -11,18 +20,11 @@ url="https://github.com/c-proof/pyglider.git", packages=find_packages(exclude=['tests']), python_requires='>=3.6', - install_requires=[ - "matplotlib", - "numpy", - "xarray", - "dask", - "bitstring", - "netcdf4", - "geojson", - "gsw", - "scipy", - "pooch", - "pyyaml" - ], + install_requires=requirements, + extras_require={ + "code_style": ["flake8<3.8.0,>=3.7.0", "black", "pre-commit==1.17.0"], + "testing": requirements_dev, + "docs": requirements_doc, + }, zip_safe=True ) From 8ed58242ba79eab938d9cfaf865d5b335683539d Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Thu, 16 Jun 2022 18:35:52 +0200 Subject: [PATCH 2/4] Add requirements --- tests/requirements.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/requirements.txt diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 0000000..33d8294 --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1,12 @@ +matplotlib +numpy +xarray +dask +netcdf4 +gsw +scipy +jinja2 +simplekml +bitstring +pytest +pooch From 6e944bd81ac16219085acf75f472ff63519ac944 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Thu, 16 Jun 2022 18:44:02 +0200 Subject: [PATCH 3/4] FIX tests --- .github/workflows/tests.yml | 2 +- environment.yml | 2 -- tests/requirements.txt | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ffcf40b..926c0d2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: activate-environment: pyglider - environment-file: environment.yml + environment-file: tests/environment.yml python-version: ${{ matrix.python-version }} channel-priority: strict use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! diff --git a/environment.yml b/environment.yml index 70d3624..8d78254 100644 --- a/environment.yml +++ b/environment.yml @@ -11,7 +11,5 @@ dependencies: - netcdf4 - gsw - scipy - - jinja2 - bitstring - - pytest - pooch diff --git a/tests/requirements.txt b/tests/requirements.txt index 33d8294..83946b0 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -9,4 +9,4 @@ jinja2 simplekml bitstring pytest -pooch +pooch \ No newline at end of file From e549c95b69309bbafa3d8e478eb920a4c066ddda Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Thu, 16 Jun 2022 18:44:55 +0200 Subject: [PATCH 4/4] FIX tests --- tests/environment.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/environment.yml diff --git a/tests/environment.yml b/tests/environment.yml new file mode 100644 index 0000000..cae946f --- /dev/null +++ b/tests/environment.yml @@ -0,0 +1,18 @@ +name: pyglider +channels: + - conda-forge + - defaults +dependencies: + - python + - numpy + - pip + - xarray + - dask + - netcdf4 + - gsw + - scipy + - jinja2 + - bitstring + - pytest + - pooch + - matplotlib