From 1ece455446f92a5760505961b55d051e38e8056a Mon Sep 17 00:00:00 2001 From: Andrew Montanez Date: Mon, 4 Mar 2024 12:30:30 -0600 Subject: [PATCH] Add dependency checker (#339) --- .github/workflows/dependency_checker.yml | 29 ++++++++++++++++++++++++ Makefile | 7 ++++++ latest_requirements.txt | 6 +++++ setup.py | 10 ++++---- 4 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/dependency_checker.yml create mode 100644 latest_requirements.txt diff --git a/.github/workflows/dependency_checker.yml b/.github/workflows/dependency_checker.yml new file mode 100644 index 00000000..0afe300e --- /dev/null +++ b/.github/workflows/dependency_checker.yml @@ -0,0 +1,29 @@ +name: Dependency Checker +on: + schedule: + - cron: '0 0 * * 1-5' + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.9 + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install .[dev] + make check-deps OUTPUT_FILEPATH=latest_requirements.txt + - name: Create pull request + id: cpr + uses: peter-evans/create-pull-request@v4 + with: + token: ${{ secrets.GH_ACCESS_TOKEN }} + commit-message: Update latest dependencies + title: Automated Latest Dependency Updates + body: "This is an auto-generated PR with **latest** dependency updates." + branch: latest-dependency-update + branch-suffix: short-commit-hash + base: main diff --git a/Makefile b/Makefile index ea6a8132..a3e3db94 100644 --- a/Makefile +++ b/Makefile @@ -238,3 +238,10 @@ release-minor: check-release bumpversion-minor release .PHONY: release-major release-major: check-release bumpversion-major release + +# Dependency targets + +.PHONY: check-deps +checkdeps: + $(eval allow_list='numpy|pandas|scikit-learn|tqdm|torch|rdt') + pip freeze | grep -v "CTGAN.git" | grep -E $(allow_list) > $(OUTPUT_FILEPATH) diff --git a/latest_requirements.txt b/latest_requirements.txt new file mode 100644 index 00000000..28aa9ce9 --- /dev/null +++ b/latest_requirements.txt @@ -0,0 +1,6 @@ +numpy==1.26.4 +pandas==2.2.1 +scikit-learn==1.4.1.post1 +tqdm==4.66.2 +torch==2.2.1 +rdt==1.9.2 \ No newline at end of file diff --git a/setup.py b/setup.py index 4a9a260b..545f5273 100644 --- a/setup.py +++ b/setup.py @@ -12,17 +12,17 @@ history = history_file.read() install_requires = [ - "numpy>=1.20.0,<2;python_version<'3.10'", - "numpy>=1.23.3,<2;python_version>='3.10'", + "numpy>=1.20.0;python_version<'3.10'", + "numpy>=1.23.3;python_version>='3.10'", "pandas>=1.1.3;python_version<'3.10'", "pandas>=1.3.4;python_version>='3.10' and python_version<'3.11'", "pandas>=1.5.0;python_version>='3.11'", - "scikit-learn>=1.1.3,<2;python_version>='3.10'", + "scikit-learn>=1.1.3;python_version>='3.10'", "torch>=1.8.0;python_version<'3.10'", "torch>=1.11.0;python_version>='3.10' and python_version<'3.11'", "torch>=2.0.0;python_version>='3.11'", - 'tqdm>=4.15,<5', - 'rdt>=1.6.1,<2.0', + 'tqdm>=4.15', + 'rdt>=1.6.1', ] setup_requires = [