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

Test minimum and maximum supported dependencies #918

Merged
merged 37 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f3a90f9
Move requirements files to subdirectory
adamjstewart Sep 4, 2024
33bb1dc
Use requirements files in CI
adamjstewart Sep 4, 2024
81082c3
Add minimum test
adamjstewart Sep 4, 2024
b4dc27b
Remove six
adamjstewart Sep 4, 2024
16e75d4
Ensure that pytest can find tests
adamjstewart Sep 4, 2024
d8f3d3b
Revert "Remove six"
adamjstewart Sep 4, 2024
398a4fe
Widest possible deps
adamjstewart Sep 4, 2024
73c889c
Update pillow and torchvision to 3.9 wheels
adamjstewart Sep 4, 2024
04c2f5f
More minimum wheel versions
adamjstewart Sep 4, 2024
59e5a37
Skip test deps for now
adamjstewart Sep 4, 2024
46da56a
Skip non-required deps
adamjstewart Sep 4, 2024
c03986a
Don't wait to start tests
adamjstewart Sep 4, 2024
ff70198
Prevent numpy 2 from being used
adamjstewart Sep 4, 2024
bd3fd52
Newer pretrainedmodels for DPN
adamjstewart Sep 4, 2024
b1f814a
pretrainedmodel 0.6 needed for senet
adamjstewart Sep 4, 2024
d863a49
efficientnet 0.6 needed for url_adv_map
adamjstewart Sep 4, 2024
4c8e94c
try 0.6.1
adamjstewart Sep 4, 2024
df1d528
timm 0.2.1 needed for efficientnet
adamjstewart Sep 4, 2024
b8d0241
timm 0.9 needed for timm.layers
adamjstewart Sep 4, 2024
a63746f
tqdm 4.36.0 needed for submodule architecture
adamjstewart Sep 4, 2024
4fec786
hf-hub 0.0.15 needed for pytorch mixin
adamjstewart Sep 4, 2024
c3a67d8
hf-hub 0.10.0 needed for ModelCard
adamjstewart Sep 4, 2024
0827645
pretrainedmodels 0.7.1 needed for last_linear
adamjstewart Sep 4, 2024
1267aab
Don't test minimum version of test deps for now
adamjstewart Sep 4, 2024
d835a41
Remove mock
adamjstewart Sep 6, 2024
e471416
hf-hub 0.22.0 needed for ModelCard.from_template(template_Str)
adamjstewart Sep 11, 2024
571f5c0
tqdm 4.42.1+ required by hf-hub 0.22.0
adamjstewart Sep 11, 2024
b3f047c
Add numpy/torch
adamjstewart Sep 11, 2024
82ab059
Newer Python version
adamjstewart Sep 11, 2024
ca431af
See if torch is causing the segfault
adamjstewart Sep 11, 2024
57035bd
Try torch 2.0.0
adamjstewart Sep 11, 2024
a8fba18
Try torch 1.10
adamjstewart Sep 11, 2024
b5c7437
torch 1.10 does not exist
adamjstewart Sep 12, 2024
c06e19c
torchvision 0.11.1
adamjstewart Sep 12, 2024
821c4ab
Try torch 1.9
adamjstewart Sep 12, 2024
e517d34
Try torch 1.8
adamjstewart Sep 12, 2024
57e55aa
Update pyproject.toml dependencies
adamjstewart Sep 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ updates:
schedule:
interval: "daily"
- package-ecosystem: "pip"
directory: "/"
directory: "/requirements"
schedule:
interval: "daily"
# Allow up to 2 open pull requests at a time
open-pull-requests-limit: 2
allow:
- dependency-name: "timm"
dependency-type: "all"
groups:
torch:
patterns:
- "torch"
- "torchvision"
ignore:
- dependency-name: "setuptools"
update-types: ["version-update:semver-patch"]
26 changes: 16 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ jobs:
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip uv
python -m uv pip install ruff==0.5.2
run: python -m pip install -r requirements/test.txt
# Update output format to enable automatic inline annotations.
- name: Run Ruff Linter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of hard running it here, what do you think about setting up the https://pre-commit.com/ here, then after you guys set up the https://pre-commit.ci into the repo, so it enables the auto-fix feature on PR's...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have mixed feelings about this. I like the ability to auto-fix issues, just not auto-commits. I'm on the fence. We haven't enabled this in TorchGeo either.

run: ruff check --output-format=github
Expand All @@ -32,18 +30,26 @@ jobs:

test:
runs-on: ubuntu-latest
needs: [style]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip uv
python -m uv pip install torch==2.3.1+cpu torchvision==0.18.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
make install_dev
run: python -m pip install -r requirements/required.txt -r requirements/test.txt
- name: Test with pytest
run: make test
run: pytest

minimum:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install dependencies
run: python -m pip install -r requirements/minimum.old -r requirements/test.txt
- name: Test with pytest
run: pytest
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ sphinx:
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
- requirements: requirements/docs.txt
5 changes: 0 additions & 5 deletions docs/requirements.txt

This file was deleted.

28 changes: 14 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,30 @@ classifiers = [
'Programming Language :: Python :: Implementation :: PyPy',
]
dependencies = [
'efficientnet-pytorch==0.7.1',
'huggingface-hub>=0.24.6',
'numpy',
'pillow',
'pretrainedmodels==0.7.4',
'six',
'timm==0.9.7',
'torch',
'torchvision>=0.5',
'tqdm',
'efficientnet-pytorch>=0.6.1',
'huggingface-hub>=0.24',
'numpy>=1.19.3',
'pillow>=8',
'pretrainedmodels>=0.7.1',
'six>=1.5',
'timm>=0.9',
adamjstewart marked this conversation as resolved.
Show resolved Hide resolved
'torch>=1.8',
'torchvision>=0.9',
'tqdm>=4.42.1',
]
dynamic = ['version']

[project.optional-dependencies]
docs = [
'autodocsumm',
'huggingface-hub',
'six==1.15.0',
'sphinx<7',
'sphinx-book-theme==1.1.2',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably test that newer versions of sphinx and sphinx-book-theme actually work, but this requires #920.

'six',
'sphinx',
'sphinx-book-theme',
]
test = [
'pytest',
'ruff==0.5.2',
'ruff',
]

[project.urls]
Expand Down
9 changes: 0 additions & 9 deletions requirements.txt

This file was deleted.

5 changes: 5 additions & 0 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
autodocsumm==0.2.13
huggingface-hub==0.24.6
six==1.16.0
sphinx==8.0.2
sphinx-book-theme==1.1.3
10 changes: 10 additions & 0 deletions requirements/minimum.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
efficientnet-pytorch==0.6.1
huggingface-hub==0.24.0
numpy==1.19.3
pillow==8.0.0
pretrainedmodels==0.7.1
six==1.5.0
timm==0.9.0
torch==1.8.0
torchvision==0.9.0
tqdm==4.42.1
10 changes: 10 additions & 0 deletions requirements/required.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
efficientnet-pytorch==0.7.1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why pin the required? Shouldn't keep it and install the latest version automatically?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is only used for CI and is controlled by dependabot. The dependencies used during installation are found in pyproject.toml.

huggingface_hub==0.24.6
numpy==2.1.1
pillow==10.4.0
pretrainedmodels==0.7.4
six==1.16.0
timm==1.0.9
torch==2.4.1
torchvision==0.19.1
tqdm==4.66.5
2 changes: 2 additions & 0 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest==8.3.3
ruff==0.6.4
Empty file added tests/__init__.py
Empty file.