From 7c22c14678f1612eec93311980265826b2bfb41a Mon Sep 17 00:00:00 2001 From: Galen Lynch Date: Tue, 11 Nov 2025 16:41:56 -0800 Subject: [PATCH 1/2] packaging: restrict python minimum version Package currently has no solution to dependencies, as judged by `uv`. Closes #91 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 46bc13f..9217b51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" name = "aind-dynamic-foraging-basic-analysis" description = "Generated from aind-library-template" license = {text = "MIT"} -requires-python = ">=3.7" +requires-python = ">=3.9" authors = [ {name = "Allen Institute for Neural Dynamics"} ] From 4a3f04d755a751853fc9cc90da96d0a6b649803b Mon Sep 17 00:00:00 2001 From: Galen Lynch Date: Tue, 11 Nov 2025 16:50:44 -0800 Subject: [PATCH 2/2] CI: change python CI version to 3.9 Minimum version for dependencies is 3.9? Not sure how this was working. Also delete init.yml which was only used to initialize the package. --- .github/workflows/init.yml | 52 --------------------------- .github/workflows/tag_and_publish.yml | 8 ++--- .github/workflows/test_and_lint.yml | 4 +-- 3 files changed, 6 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/init.yml diff --git a/.github/workflows/init.yml b/.github/workflows/init.yml deleted file mode 100644 index 0336013..0000000 --- a/.github/workflows/init.yml +++ /dev/null @@ -1,52 +0,0 @@ -# Workflow runs only once when the template is first used. -# File can be safely deleted after repo is initialized. -name: Initialize repository -on: - push: - branches: - - main - -jobs: - initialize-package: - name: Initialize the package - if: ${{github.event.repository.name != 'aind-library-template'}} - runs-on: ubuntu-latest - env: - REPO_NAME: ${{ github.event.repository.name }} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Rename package - run: | - pkg_name=$(echo "${REPO_NAME}" | tr - _) - current_description='description = "Prints messages to stdout. Simple boilerplate for libraries."' - new_description='description = "Generated from aind-library-template"' - readme_description='Template for a minimal, basic repository for an AIND library.' - new_readme_description='Generated from aind-library-template' - echo "Package Name ${pkg_name}" - mkdir src/${pkg_name} - touch src/${pkg_name}/__init__.py - echo '"""Init package"""' >> src/${pkg_name}/__init__.py - echo '__version__ = "0.0.0"' >> src/${pkg_name}/__init__.py - sed -i "s/aind_library_template/${pkg_name}/" pyproject.toml - sed -i "s/aind-library-template/${REPO_NAME}/" pyproject.toml - sed -i "s/aind_library_template/${pkg_name}/" doc_template/source/conf.py - sed -i "s/${current_description}/${new_description}/" pyproject.toml - sed -i "/pandas/d" pyproject.toml - sed -i "s/aind-library-template/${REPO_NAME}/" README.md - sed -i "s/${readme_description}/${new_readme_description}/" README.md - - name: Commit changes - uses: EndBug/add-and-commit@v9 - with: - default_author: github_actions - message: "ci: version bump [skip actions]" - add: '["pyproject.toml", "README.md", "src/*", "doc_template/source/conf.py"]' - remove: '["-r src/aind_library_template", "tests/test_message_handler.py"]' - - name: Add first tag - run: | - git tag v0.0.0 - git push origin v0.0.0 - - name: Disable workflow - run: | - gh workflow disable -R $GITHUB_REPOSITORY "${{ github.workflow }}" diff --git a/.github/workflows/tag_and_publish.yml b/.github/workflows/tag_and_publish.yml index 3d055f0..96878be 100644 --- a/.github/workflows/tag_and_publish.yml +++ b/.github/workflows/tag_and_publish.yml @@ -16,10 +16,10 @@ jobs: ref: ${{ env.DEFAULT_BRANCH }} fetch-depth: 0 token: ${{ secrets.SERVICE_TOKEN }} - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v3 with: - python-version: 3.8 + python-version: 3.9 - name: Install dependencies run: | python -m pip install -e .[dev] --no-cache-dir @@ -73,10 +73,10 @@ jobs: - uses: actions/checkout@v3 - name: Pull latest changes run: git pull origin main - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 - name: Install dependencies run: | pip install --upgrade setuptools wheel twine build diff --git a/.github/workflows/test_and_lint.yml b/.github/workflows/test_and_lint.yml index c8d832d..171f413 100644 --- a/.github/workflows/test_and_lint.yml +++ b/.github/workflows/test_and_lint.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.8', '3.9', '3.10' ] + python-version: [ '3.9', '3.10' ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -18,7 +18,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: | + run: | python -m pip install -e .[dev] - name: Run linter checks run: flake8 . && interrogate --verbose .