Skip to content

Commit

Permalink
prune-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Jan 17, 2022
1 parent 6d97216 commit 613800e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
22 changes: 22 additions & 0 deletions .github/assistant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from pprint import pprint

import fire


class AssistantCLI:
@staticmethod
def prune_packages(req_file: str, *pkgs: str) -> None:
"""Prune packages from requirement file."""
with open(req_file) as fp:
lines = fp.readlines()

for pkg in pkgs:
lines = [ln for ln in lines if not ln.startswith(pkg)]
pprint(lines)

with open(req_file, "w") as fp:
fp.writelines(lines)


if __name__ == "__main__":
fire.Fire(AssistantCLI)
18 changes: 0 additions & 18 deletions .github/prune-packages.py

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/ci_test-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
python-version: ["3.8"]
pytorch-version: ["1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11"]
include:
- python-version: 3.7
pytorch-version: '1.3'
- {python-version: 3.7, pytorch-version: '1.3'}
env:
PYTEST_ARTEFACT: test-conda-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}.xml
TRANSFORMERS_CACHE: .cache/huggingface/
Expand Down Expand Up @@ -83,7 +82,8 @@ jobs:
conda list
pip --version
python ./requirements/adjust-versions.py requirements.txt
python ./.github/prune-packages.py requirements/image.txt torchvision
python ./.github/assistant.py prune-packages requirements/image.txt torchvision
python ./.github/assistant.py prune-packages requirements/detection.txt torchvision
pip install -q "numpy==1.20.0" # try to fix cocotools for PT 1.4 & 1.9
pip install --requirement requirements.txt --quiet
pip install --requirement requirements/devel.txt --quiet
Expand Down
1 change: 1 addition & 0 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ twine>=3.2
mypy>=0.790
phmdoctest>=1.1.1
pre-commit>=1.0
fire

cloudpickle>=1.3
scikit-learn>=0.24

0 comments on commit 613800e

Please sign in to comment.