From bb7edb9021618a76917369e69dd515cb6c2bf5eb Mon Sep 17 00:00:00 2001 From: Jeremy Pinto Date: Wed, 27 Nov 2024 10:44:30 -0500 Subject: [PATCH 01/13] switch to uv for ci actions --- .github/workflows/ci.yml | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a41f74b..30bfe00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,31 +14,34 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: python-3.11 - uses: actions/setup-python@v2 - with: - python-version: 3.11 + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v3 + + - name: Set up Python + run: uv python install 3.11 + - name: linting checks run: | - python -m pip install --upgrade pip - pip install flake8 flake8-docstrings isort + uv pip install flake8 flake8-docstrings isort sh hooks/pre-commit - - name: install project dependencies - run: | - pip install -e . + + - name: Install the project + run: uv sync --all-extras --dev + - name: unit tests run: | - pytest --cov=amlrt-project + uv run pytest --cov=amlrt-project - name: pytorch-end2end-single run: | - ./tests/end2end_pytorch/run_single.sh + uv run ./tests/end2end_pytorch/run_single.sh - name: pytorch-end2end-orion run: | - ./tests/end2end_pytorch/run_orion.sh + uv run ./tests/end2end_pytorch/run_orion.sh - name: type checking run: | - pytype amlrt_project/ + uv run pytype amlrt_project/ - name: doc-creation-test run: | - ./tests/test_docs/run.sh + uv run ./tests/test_docs/run.sh From b774db0e0bb7d9d20d36d60c0761991811afaa34 Mon Sep 17 00:00:00 2001 From: Jeremy Pinto Date: Wed, 27 Nov 2024 10:48:33 -0500 Subject: [PATCH 02/13] init uv first --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30bfe00..1954ca2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,9 @@ jobs: - name: linting checks run: | - uv pip install flake8 flake8-docstrings isort - sh hooks/pre-commit + uv init + uv add install flake8 flake8-docstrings isort + uv run sh hooks/pre-commit - name: Install the project run: uv sync --all-extras --dev From b41b7f77a3f14c17044fc342c45dc7a98d3a91cb Mon Sep 17 00:00:00 2001 From: Jeremy Pinto Date: Wed, 27 Nov 2024 10:51:35 -0500 Subject: [PATCH 03/13] change order --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1954ca2..8bb1914 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,15 +22,15 @@ jobs: - name: Set up Python run: uv python install 3.11 + + - name: Install the project + run: uv sync --all-extras --dev + - name: linting checks run: | - uv init uv add install flake8 flake8-docstrings isort uv run sh hooks/pre-commit - - name: Install the project - run: uv sync --all-extras --dev - - name: unit tests run: | uv run pytest --cov=amlrt-project From ccf09e43f907018fe7c9a9766f80e06e99682c18 Mon Sep 17 00:00:00 2001 From: Jeremy Pinto Date: Wed, 27 Nov 2024 10:55:43 -0500 Subject: [PATCH 04/13] switch over to pyproject.toml --- pyproject.toml | 42 ++++++++++++++++++++++++++++++++++++++++++ setup.py | 41 ----------------------------------------- 2 files changed, 42 insertions(+), 41 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6811e36 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,42 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "amlrt_project" +version = "3.2.0" +requires-python = ">=3.11" +dependencies = [ + 'aim==3.18.1; os_name!="nt"', + "comet-ml==3.39.3", + "flake8==4.0.1", + "flake8-docstrings==1.6.0", + "gitpython==3.1.27", + "jupyter==1.0.0", + "jinja2==3.1.2", + "myst-parser==2.0.0", + "omegaconf==2.3.0", + "orion>=0.2.4.post1", + "pyyaml==6.0", + "pytest==7.1.2", + "pytest-cov==3.0.0", + "pytorch_lightning==2.2.1", + "pytype==2024.2.27", + "sphinx==7.2.6", + "sphinx-autoapi==3.0.0", + "sphinx-rtd-theme==1.3.0", + "sphinxcontrib-napoleon==0.7", + "sphinxcontrib-katex==0.9.9", + "tensorboard==2.16.2", + "tqdm==4.64.0", + "torch==2.2.1", + "torchvision==0.17.1", +] + +[tool.setuptools.packages.find] +include = ["amlrt_project", "amlrt_project.*"] + +[project.scripts] +amlrt_project_train = "amlrt_project.train:main" +amlrt_project_eval = "amlrt_project.evaluate:main" +amlrt_project_merge_configs = "amlrt_project.utils.config_utils:main" diff --git a/setup.py b/setup.py deleted file mode 100644 index 8633a97..0000000 --- a/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -from setuptools import find_packages, setup - -setup( - name='amlrt_project', - version='3.2.0', - packages=find_packages(include=['amlrt_project', 'amlrt_project.*']), - python_requires='>=3.11', - install_requires=[ - 'aim==3.18.1; os_name!="nt"', - 'comet-ml==3.39.3', - 'flake8==4.0.1', - 'flake8-docstrings==1.6.0', - 'gitpython==3.1.27', - 'jupyter==1.0.0', - 'jinja2==3.1.2', - 'myst-parser==2.0.0', - 'omegaconf==2.3.0', - 'orion>=0.2.4.post1', - 'pyyaml==6.0', - 'pytest==7.1.2', - 'pytest-cov==3.0.0', - 'pytorch_lightning==2.2.1', - 'pytype==2024.2.27', - 'sphinx==7.2.6', - 'sphinx-autoapi==3.0.0', - 'sphinx-rtd-theme==1.3.0', - 'sphinxcontrib-napoleon==0.7', - 'sphinxcontrib-katex==0.9.9', - 'tensorboard==2.16.2', - 'tqdm==4.64.0', - 'torch==2.2.1', - 'torchvision==0.17.1', - ], - entry_points={ - 'console_scripts': [ - 'amlrt_project_train=amlrt_project.train:main', - 'amlrt_project_eval=amlrt_project.evaluate:main', - 'amlrt_project_merge_configs=amlrt_project.utils.config_utils:main' - ], - } -) From 087467d20a137889fc9db6610c5d1404505c19ae Mon Sep 17 00:00:00 2001 From: Jeremy Pinto Date: Wed, 27 Nov 2024 10:59:17 -0500 Subject: [PATCH 05/13] bump down python (for now) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6811e36..899f510 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "amlrt_project" version = "3.2.0" -requires-python = ">=3.11" +requires-python = ">=3.10" dependencies = [ 'aim==3.18.1; os_name!="nt"', "comet-ml==3.39.3", From c734413dd928b77fb03fe9144bf5c4942f1c1297 Mon Sep 17 00:00:00 2001 From: Jeremy Pinto Date: Wed, 27 Nov 2024 11:00:08 -0500 Subject: [PATCH 06/13] bump back python --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 899f510..6811e36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "amlrt_project" version = "3.2.0" -requires-python = ">=3.10" +requires-python = ">=3.11" dependencies = [ 'aim==3.18.1; os_name!="nt"', "comet-ml==3.39.3", From 5076b35cb9dfbe45a5451333d682eed42345189b Mon Sep 17 00:00:00 2001 From: Jeremy Pinto Date: Wed, 27 Nov 2024 11:14:51 -0500 Subject: [PATCH 07/13] lint first --- .github/workflows/ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8bb1914..e81a426 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,15 +22,14 @@ jobs: - name: Set up Python run: uv python install 3.11 - - - name: Install the project - run: uv sync --all-extras --dev - - name: linting checks run: | uv add install flake8 flake8-docstrings isort uv run sh hooks/pre-commit + - name: Install the project + run: uv sync --all-extras --dev + - name: unit tests run: | uv run pytest --cov=amlrt-project From f5b41478c1596448cfb0d1cf7213d2222f0e42e8 Mon Sep 17 00:00:00 2001 From: Jeremy Pinto Date: Wed, 27 Nov 2024 11:18:01 -0500 Subject: [PATCH 08/13] use uv pip --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e81a426..fbdca3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: linting checks run: | - uv add install flake8 flake8-docstrings isort + uv pip install flake8 flake8-docstrings isort uv run sh hooks/pre-commit - name: Install the project From 7ef1aaef30ae465ba267309f869d466129bfcf3b Mon Sep 17 00:00:00 2001 From: Jeremy Pinto Date: Wed, 27 Nov 2024 11:19:07 -0500 Subject: [PATCH 09/13] create venv --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbdca3d..7fb70a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ jobs: - name: linting checks run: | + uv venv uv pip install flake8 flake8-docstrings isort uv run sh hooks/pre-commit From 395cfe836bf0cd7e293649a4fdd3731304d63777 Mon Sep 17 00:00:00 2001 From: Jeremy Pinto Date: Wed, 27 Nov 2024 11:32:22 -0500 Subject: [PATCH 10/13] add uv contraint --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 6811e36..820adba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,9 @@ dependencies = [ [tool.setuptools.packages.find] include = ["amlrt_project", "amlrt_project.*"] +[tool.uv] +constraint-dependencies = ["kaleido!=0.2.1.post1"] + [project.scripts] amlrt_project_train = "amlrt_project.train:main" amlrt_project_eval = "amlrt_project.evaluate:main" From f30b6f9a6baaf2c26b6bd046e6cd09ba9b3f1562 Mon Sep 17 00:00:00 2001 From: Jeremy Pinto Date: Wed, 27 Nov 2024 11:34:25 -0500 Subject: [PATCH 11/13] change run script command --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fb70a0..c64208c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,13 +36,13 @@ jobs: uv run pytest --cov=amlrt-project - name: pytorch-end2end-single run: | - uv run ./tests/end2end_pytorch/run_single.sh + uv run tests/end2end_pytorch/run_single.sh - name: pytorch-end2end-orion run: | - uv run ./tests/end2end_pytorch/run_orion.sh + uv run tests/end2end_pytorch/run_orion.sh - name: type checking run: | uv run pytype amlrt_project/ - name: doc-creation-test run: | - uv run ./tests/test_docs/run.sh + uv run tests/test_docs/run.sh From ca9e0dcd58cc0cb4f80b11a405044a0ec2911b0f Mon Sep 17 00:00:00 2001 From: Jeremy Pinto Date: Wed, 27 Nov 2024 14:37:04 -0500 Subject: [PATCH 12/13] add bash to run --- .github/workflows/ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c64208c..4360398 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,8 @@ jobs: - name: linting checks run: | uv venv - uv pip install flake8 flake8-docstrings isort + source .venv/bin/activate + uv pip install flake8 flake8-docstrings isort pip uv run sh hooks/pre-commit - name: Install the project @@ -36,13 +37,13 @@ jobs: uv run pytest --cov=amlrt-project - name: pytorch-end2end-single run: | - uv run tests/end2end_pytorch/run_single.sh + uv run sh tests/end2end_pytorch/run_single.sh - name: pytorch-end2end-orion run: | - uv run tests/end2end_pytorch/run_orion.sh + uv run sh tests/end2end_pytorch/run_orion.sh - name: type checking run: | - uv run pytype amlrt_project/ + uv run sh pytype amlrt_project/ - name: doc-creation-test run: | - uv run tests/test_docs/run.sh + uv run sh tests/test_docs/run.sh From d843a676954f629053ac8d0743841522cbd7bfbe Mon Sep 17 00:00:00 2001 From: Jeremy Pinto Date: Wed, 27 Nov 2024 14:39:35 -0500 Subject: [PATCH 13/13] activate venv --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4360398..ce46c76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,7 @@ jobs: uv run pytest --cov=amlrt-project - name: pytorch-end2end-single run: | + source .venv/bin/activate uv run sh tests/end2end_pytorch/run_single.sh - name: pytorch-end2end-orion run: |