From fd4865132eea97e9524fd68e89b3ef1cbf26347d Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 14 Mar 2025 12:36:18 -0500 Subject: [PATCH 01/25] =?UTF-8?q?ci:=20=F0=9F=8E=A8=20consolidate=20doc=20?= =?UTF-8?q?release=20by=20workflow=5Fcall?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/development.yaml | 15 ++------------- .github/workflows/docs.yaml | 1 + 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/development.yaml b/.github/workflows/development.yaml index 63960b6c2..369a66d0e 100644 --- a/.github/workflows/development.yaml +++ b/.github/workflows/development.yaml @@ -122,25 +122,14 @@ jobs: uses: actions/checkout@v4 - name: Codespell uses: codespell-project/actions-codespell@v2 - publish-docs: + call-publish-docs: if: | github.event_name == 'push' && startsWith(github.ref, 'refs/tags') needs: test runs-on: ubuntu-latest - env: - DOCKER_CLIENT_TIMEOUT: "120" - COMPOSE_HTTP_TIMEOUT: "120" steps: - - uses: actions/checkout@v4 - - name: Deploy docs - run: | - export MODE=BUILD - export PACKAGE=datajoint - export UPSTREAM_REPO=https://github.com/${GITHUB_REPOSITORY}.git - export HOST_UID=$(id -u) - docker compose -f docs/docker-compose.yaml up --quiet-pull --exit-code-from docs --build - git push origin gh-pages + - uses: ./.github/workflows/docs.yaml publish-release: if: | github.event_name == 'push' && diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 897e39e5f..4eb1b04cf 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,6 +1,7 @@ name: Manual docs release on: workflow_dispatch: + workflow_call: jobs: publish-docs: runs-on: ubuntu-latest From 6490bf0f14ce4a82a4fe6807a91c47c8e1d3b849 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 14 Mar 2025 13:02:57 -0500 Subject: [PATCH 02/25] =?UTF-8?q?test:=20=F0=9F=A7=AA=20update=20ci=20matr?= =?UTF-8?q?ix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/development.yaml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/development.yaml b/.github/workflows/development.yaml index 369a66d0e..534bca6df 100644 --- a/.github/workflows/development.yaml +++ b/.github/workflows/development.yaml @@ -58,18 +58,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - py_ver: ["3.9"] - mysql_ver: ["8.0", "5.7"] + py_ver: ["3.9", "3.10", "3.11", "3.12", "3.13"] + mysql_ver: ["8.0"] include: - - py_ver: "3.13" - mysql_ver: "8.0" - - py_ver: "3.12" - mysql_ver: "8.0" - - py_ver: "3.11" - mysql_ver: "8.0" - - py_ver: "3.10" - mysql_ver: "8.0" - - py_ver: "3.8" + - py_ver: "3.9" mysql_ver: "5.7" steps: - uses: actions/checkout@v4 From 7d2f539e115afaaa74e2b8f4cd400502dca37fba Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 14 Mar 2025 13:27:37 -0500 Subject: [PATCH 03/25] =?UTF-8?q?fix:=20=F0=9F=90=9B=20add=20missing=20fla?= =?UTF-8?q?ke8=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3ba3bdac1..426751d3c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,6 +36,15 @@ repos: - repo: https://github.com/PyCQA/flake8 rev: 7.1.2 hooks: + # syntax tests + - id: flake8 + args: + - --select=E9,F63,F7,F82 + - --count + - --show-source + - --statistics + files: datajoint # a lot of files in tests are not compliant + # style tests - id: flake8 args: - --ignore=E203,E722,W503 From 7b1d5fb9cc999c880c22ec123d26b7a37ee40128 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 14 Mar 2025 13:46:17 -0500 Subject: [PATCH 04/25] =?UTF-8?q?ci:=20=F0=9F=8E=A8=20re-organize=20ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/close_inactive_issues.yaml | 2 +- .github/workflows/development.yaml | 122 ++++++++----------- .github/workflows/label_issues.yaml | 2 +- 3 files changed, 56 insertions(+), 70 deletions(-) diff --git a/.github/workflows/close_inactive_issues.yaml b/.github/workflows/close_inactive_issues.yaml index 4710e1df6..e08f471a2 100644 --- a/.github/workflows/close_inactive_issues.yaml +++ b/.github/workflows/close_inactive_issues.yaml @@ -19,4 +19,4 @@ jobs: close-issue-message: "This issue was closed because it has been inactive for 365 days since being marked as stale, please reopen if it's still applicable." days-before-pr-stale: 45 # for initial period, suggest 15 days-before-pr-close: 365 # for initial period, suggest 30 - repo-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/development.yaml b/.github/workflows/development.yaml index 534bca6df..1de9a81fe 100644 --- a/.github/workflows/development.yaml +++ b/.github/workflows/development.yaml @@ -13,8 +13,53 @@ on: - "!gh-pages" # exclude gh-pages branch - "!stage*" # exclude branches beginning with stage jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + # enforce the same check as pre-commit + # but only run important checks + - uses: pre-commit/action@v3.0.1 + with: + extra_args: codespell --all-files + - uses: pre-commit/action@v3.0.1 + with: + extra_args: black --all-files + - uses: pre-commit/action@v3.0.1 + with: + extra_args: flake8 --all-files + test: + runs-on: ubuntu-latest + need: lint + strategy: + matrix: + py_ver: ["3.9", "3.10", "3.11", "3.12", "3.13"] + mysql_ver: ["8.0"] + include: + - py_ver: "3.9" + mysql_ver: "5.7" + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{matrix.py_ver}} + uses: actions/setup-python@v5 + with: + python-version: ${{matrix.py_ver}} + - name: Run primary tests + env: + PY_VER: ${{matrix.py_ver}} + DJ_PASS: password + MYSQL_VER: ${{matrix.mysql_ver}} + DISTRO: alpine + MINIO_VER: RELEASE.2021-09-03T03-56-13Z + DOCKER_CLIENT_TIMEOUT: "120" + COMPOSE_HTTP_TIMEOUT: "120" + run: | + export HOST_UID=$(id -u) + docker compose --profile test up --quiet-pull --build --exit-code-from djtest djtest build: runs-on: ubuntu-latest + need: test strategy: matrix: include: @@ -54,74 +99,6 @@ jobs: name: pip-datajoint-${{env.DJ_VERSION}} path: dist retention-days: 1 - test: - runs-on: ubuntu-latest - strategy: - matrix: - py_ver: ["3.9", "3.10", "3.11", "3.12", "3.13"] - mysql_ver: ["8.0"] - include: - - py_ver: "3.9" - mysql_ver: "5.7" - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{matrix.py_ver}} - uses: actions/setup-python@v5 - with: - python-version: ${{matrix.py_ver}} - - name: Run primary tests - env: - PY_VER: ${{matrix.py_ver}} - DJ_PASS: password - MYSQL_VER: ${{matrix.mysql_ver}} - DISTRO: alpine - MINIO_VER: RELEASE.2021-09-03T03-56-13Z - DOCKER_CLIENT_TIMEOUT: "120" - COMPOSE_HTTP_TIMEOUT: "120" - run: | - export HOST_UID=$(id -u) - docker compose --profile test up --quiet-pull --build --exit-code-from djtest djtest - lint: - runs-on: ubuntu-latest - strategy: - matrix: - py_ver: ["3.11"] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{matrix.py_ver}} - uses: actions/setup-python@v5 - with: - python-version: ${{matrix.py_ver}} - - name: Install dependencies - run: | - python3 -m pip install --upgrade pip - python3 -m pip install ".[test]" - - name: Run syntax tests - run: flake8 datajoint --count --select=E9,F63,F7,F82 --show-source --statistics - - name: Run style tests - run: | - flake8 --ignore=E203,E722,W503 datajoint \ - --count --max-complexity=62 --max-line-length=127 --statistics \ - --per-file-ignores='datajoint/diagram.py:C901' - black --required-version '24.2.0' --check -v datajoint tests --diff - codespell: - name: Check for spelling errors - permissions: - contents: read - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Codespell - uses: codespell-project/actions-codespell@v2 - call-publish-docs: - if: | - github.event_name == 'push' && - startsWith(github.ref, 'refs/tags') - needs: test - runs-on: ubuntu-latest - steps: - - uses: ./.github/workflows/docs.yaml publish-release: if: | github.event_name == 'push' && @@ -220,3 +197,12 @@ jobs: && docker tag "${IMAGE}:${TAG}" "${IMAGE}:latest" \ && docker push "${IMAGE}:latest" \ || echo "skipping 'latest' tag..." + # only release docs when a release is published + call-publish-docs: + if: | + github.event_name == 'push' && + startsWith(github.ref, 'refs/tags') + needs: publish-release + runs-on: ubuntu-latest + steps: + - uses: ./.github/workflows/docs.yaml diff --git a/.github/workflows/label_issues.yaml b/.github/workflows/label_issues.yaml index 9504b5705..d5f99f015 100644 --- a/.github/workflows/label_issues.yaml +++ b/.github/workflows/label_issues.yaml @@ -15,4 +15,4 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} NUMBER: ${{ github.event.issue.number }} - LABELS: triage \ No newline at end of file + LABELS: triage From 12f9a8ce80fb284b04a0bb802decd380091fb2f1 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 14 Mar 2025 13:47:03 -0500 Subject: [PATCH 05/25] =?UTF-8?q?fix:=20=F0=9F=90=9B=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/development.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/development.yaml b/.github/workflows/development.yaml index 1de9a81fe..4b9f37aa6 100644 --- a/.github/workflows/development.yaml +++ b/.github/workflows/development.yaml @@ -59,7 +59,7 @@ jobs: docker compose --profile test up --quiet-pull --build --exit-code-from djtest djtest build: runs-on: ubuntu-latest - need: test + needs: test strategy: matrix: include: From 3fcd16f87fed8d2125cf31eb087fd7798d51e842 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 14 Mar 2025 13:47:57 -0500 Subject: [PATCH 06/25] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20dependency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/development.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/development.yaml b/.github/workflows/development.yaml index 4b9f37aa6..1c45fa418 100644 --- a/.github/workflows/development.yaml +++ b/.github/workflows/development.yaml @@ -31,7 +31,7 @@ jobs: extra_args: flake8 --all-files test: runs-on: ubuntu-latest - need: lint + needs: lint strategy: matrix: py_ver: ["3.9", "3.10", "3.11", "3.12", "3.13"] @@ -103,7 +103,7 @@ jobs: if: | github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - needs: test + needs: build runs-on: ubuntu-latest strategy: matrix: From b165b9848e9bbbe146664b89563e172b36e03025 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 14 Mar 2025 15:58:15 -0500 Subject: [PATCH 07/25] =?UTF-8?q?ci:=20=F0=9F=8E=A8=20split=20test=20and?= =?UTF-8?q?=20release=20ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{development.yaml => release.yaml} | 60 +------------------ .github/workflows/test.yaml | 57 ++++++++++++++++++ 2 files changed, 59 insertions(+), 58 deletions(-) rename .github/workflows/{development.yaml => release.yaml} (76%) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/development.yaml b/.github/workflows/release.yaml similarity index 76% rename from .github/workflows/development.yaml rename to .github/workflows/release.yaml index 1c45fa418..b8e3e7ca5 100644 --- a/.github/workflows/development.yaml +++ b/.github/workflows/release.yaml @@ -1,65 +1,9 @@ -name: Development +name: Release on: - push: - branches: - - "**" # every branch - - "!gh-pages" # exclude gh-pages branch - - "!stage*" # exclude branches beginning with stage - tags: - - '\d+\.\d+\.\d+' # only semver tags - pull_request: - branches: - - "**" # every branch - - "!gh-pages" # exclude gh-pages branch - - "!stage*" # exclude branches beginning with stage + workflow_dispatch: jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - # enforce the same check as pre-commit - # but only run important checks - - uses: pre-commit/action@v3.0.1 - with: - extra_args: codespell --all-files - - uses: pre-commit/action@v3.0.1 - with: - extra_args: black --all-files - - uses: pre-commit/action@v3.0.1 - with: - extra_args: flake8 --all-files - test: - runs-on: ubuntu-latest - needs: lint - strategy: - matrix: - py_ver: ["3.9", "3.10", "3.11", "3.12", "3.13"] - mysql_ver: ["8.0"] - include: - - py_ver: "3.9" - mysql_ver: "5.7" - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{matrix.py_ver}} - uses: actions/setup-python@v5 - with: - python-version: ${{matrix.py_ver}} - - name: Run primary tests - env: - PY_VER: ${{matrix.py_ver}} - DJ_PASS: password - MYSQL_VER: ${{matrix.mysql_ver}} - DISTRO: alpine - MINIO_VER: RELEASE.2021-09-03T03-56-13Z - DOCKER_CLIENT_TIMEOUT: "120" - COMPOSE_HTTP_TIMEOUT: "120" - run: | - export HOST_UID=$(id -u) - docker compose --profile test up --quiet-pull --build --exit-code-from djtest djtest build: runs-on: ubuntu-latest - needs: test strategy: matrix: include: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 000000000..99ddcd67e --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,57 @@ +name: Test +on: + push: + branches: + - "**" # every branch + - "!gh-pages" # exclude gh-pages branch + - "!stage*" # exclude branches beginning with stage + pull_request: + branches: + - "**" # every branch + - "!gh-pages" # exclude gh-pages branch + - "!stage*" # exclude branches beginning with stage +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + # enforce the same check as pre-commit + # but only run important checks + - uses: pre-commit/action@v3.0.1 + with: + extra_args: codespell --all-files + - uses: pre-commit/action@v3.0.1 + with: + extra_args: black --all-files + - uses: pre-commit/action@v3.0.1 + with: + extra_args: flake8 --all-files + test: + runs-on: ubuntu-latest + needs: lint + strategy: + matrix: + py_ver: ["3.9", "3.10", "3.11", "3.12", "3.13"] + mysql_ver: ["8.0"] + include: + - py_ver: "3.9" + mysql_ver: "5.7" + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{matrix.py_ver}} + uses: actions/setup-python@v5 + with: + python-version: ${{matrix.py_ver}} + - name: Run primary tests + env: + PY_VER: ${{matrix.py_ver}} + DJ_PASS: password + MYSQL_VER: ${{matrix.mysql_ver}} + DISTRO: alpine + MINIO_VER: RELEASE.2021-09-03T03-56-13Z + DOCKER_CLIENT_TIMEOUT: "120" + COMPOSE_HTTP_TIMEOUT: "120" + run: | + export HOST_UID=$(id -u) + docker compose --profile test up --quiet-pull --build --exit-code-from djtest djtest From 1449c1b174413992c112ee937f00303bf5e30a80 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 14 Mar 2025 16:36:15 -0500 Subject: [PATCH 08/25] =?UTF-8?q?fix:=20=F0=9F=90=9B=20found=20pyproject.t?= =?UTF-8?q?oml=20and=20version.py=20out=20of=20sync?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6040be300..ccc6987ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "datajoint" -version = "0.14.3" +version = "0.14.4" dependencies = [ "numpy", "pymysql>=0.7.2", From 4ff6af43dafb015a582b1c5663554a5d6bebf797 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 14 Mar 2025 17:06:41 -0500 Subject: [PATCH 09/25] =?UTF-8?q?ci:=20=F0=9F=8E=A8=20improvements=20and?= =?UTF-8?q?=20cleanups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docs.yaml | 3 --- .github/workflows/test.yaml | 8 ++------ docker-compose.yaml | 2 +- pyproject.toml | 34 +++++++++++++++++++++++++++------- 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 4eb1b04cf..f434d63d7 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -5,9 +5,6 @@ on: jobs: publish-docs: runs-on: ubuntu-latest - env: - DOCKER_CLIENT_TIMEOUT: "120" - COMPOSE_HTTP_TIMEOUT: "120" steps: - uses: actions/checkout@v4 - name: Deploy docs diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 99ddcd67e..94b26d242 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -43,15 +43,11 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{matrix.py_ver}} - - name: Run primary tests + - name: Integration test env: PY_VER: ${{matrix.py_ver}} - DJ_PASS: password MYSQL_VER: ${{matrix.mysql_ver}} - DISTRO: alpine - MINIO_VER: RELEASE.2021-09-03T03-56-13Z - DOCKER_CLIENT_TIMEOUT: "120" - COMPOSE_HTTP_TIMEOUT: "120" + # taking default variables set in docker-compose.yaml to sync with local test run: | export HOST_UID=$(id -u) docker compose --profile test up --quiet-pull --build --exit-code-from djtest djtest diff --git a/docker-compose.yaml b/docker-compose.yaml index 9e413bdb3..d09d06d49 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,7 +15,7 @@ services: retries: 5 interval: 15s minio: - image: minio/minio:${MINIO_VER:-RELEASE.2022-08-11T04-37-28Z} + image: minio/minio:${MINIO_VER:-RELEASE.2025-02-28T09-55-16Z} environment: - MINIO_ACCESS_KEY=datajoint - MINIO_SECRET_KEY=datajoint diff --git a/pyproject.toml b/pyproject.toml index ccc6987ca..bae73a923 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,6 @@ [project] name = "datajoint" +# should to be auto synced with datajoint/version.py:__version__ version = "0.14.4" dependencies = [ "numpy", @@ -18,7 +19,7 @@ dependencies = [ "cryptography", "urllib3" ] -requires-python = ">=3.8,<4.0" +requires-python = ">=3.9,<4.0" authors = [ {name = "Dimitri Yatsenko", email = "dimitri@datajoint.com"}, {name = "Raphael Guzman"}, @@ -29,17 +30,36 @@ maintainers = [ {name = "Dimitri Yatsenko", email = "dimitri@datajoint.com"}, {name = "DataJoint Contributors", email = "support@datajoint.com"}, ] -description = "A relational data pipeline framework." +# manually sync here: https://datajoint.com/docs/core/datajoint-python/latest/#welcome-to-datajoint-for-python +description = "DataJoint for Python is a framework for scientific workflow management based on relational principles. DataJoint is built on the foundation of the relational data model and prescribes a consistent method for organizing, populating, computing, and querying data." readme = "README.md" license = {file = "LICENSE.txt"} keywords = [ "database", - "data pipelines", - "scientific computing", - "automated research workflows", + "automated", + "automation", + "compute", + "data", + "pipeline", + "workflow", + "scientific", + "science", + "research", + "neuroscience", + "bioinformatics", + "bio-informatics", + "datajoint", ] +# https://pypi.org/classifiers/ classifiers = [ - "Programming Language :: Python" + "Programming Language :: Python", + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Science/Research", + "Intended Audience :: Healthcare Industry", + "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Bio-Informatics", + "Topic :: Scientific/Engineering :: Neuroscience", # Not standard, but just in case ] [project.optional-dependencies] @@ -56,7 +76,7 @@ Homepage = "https://datajoint.com/docs" Documentation = "https://datajoint.com/docs" Repository = "https://github.com/datajoint/datajoint-python" "Bug Tracker" = "https://github.com/datajoint/datajoint-python/issues" -Changelog = "https://github.com/datajoint/datajoint-python/blob/master/CHANGELOG.md" +"Release Notes" = "https://github.com/datajoint/datajoint-python/releases" [project.entry-points."console_scripts"] dj = "datajoint.cli:cli" From cff51871ae0748137da62220d223f1b5ceb0526d Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 14 Mar 2025 17:35:59 -0500 Subject: [PATCH 10/25] =?UTF-8?q?fix:=20=F0=9F=8E=A8=20black=20failed=20af?= =?UTF-8?q?ter=20changing=20pyproject.toml:required-python=3D">=3D3.8->3.9?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- datajoint/autopopulate.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/datajoint/autopopulate.py b/datajoint/autopopulate.py index d0b0a67c6..a57d74a89 100644 --- a/datajoint/autopopulate.py +++ b/datajoint/autopopulate.py @@ -265,13 +265,16 @@ def handler(signum, frame): # spawn multiple processes self.connection.close() # disconnect parent process from MySQL server del self.connection._conn.ctx # SSLContext is not pickleable - with mp.Pool( - processes, _initialize_populate, (self, jobs, populate_kwargs) - ) as pool, ( - tqdm(desc="Processes: ", total=nkeys) - if display_progress - else contextlib.nullcontext() - ) as progress_bar: + with ( + mp.Pool( + processes, _initialize_populate, (self, jobs, populate_kwargs) + ) as pool, + ( + tqdm(desc="Processes: ", total=nkeys) + if display_progress + else contextlib.nullcontext() + ) as progress_bar, + ): for status in pool.imap(_call_populate1, keys, chunksize=1): if status is True: success_list.append(1) From 076286dc2671ddbc7773a25131b56d3170f97184 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 14 Mar 2025 17:40:13 -0500 Subject: [PATCH 11/25] =?UTF-8?q?build:=20=F0=9F=9A=A7=20improving=20pypro?= =?UTF-8?q?ject.yaml=20and=20release:build=20step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yaml | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b8e3e7ca5..b075b7bf7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,37 +7,21 @@ jobs: strategy: matrix: include: - - py_ver: "3.9" - distro: debian - image: djbase + - py_ver: ["3.9", "3.10", "3.11", "3.12", "3.13"] env: PY_VER: ${{matrix.py_ver}} - DISTRO: ${{matrix.distro}} - IMAGE: ${{matrix.image}} - DOCKER_CLIENT_TIMEOUT: "120" - COMPOSE_HTTP_TIMEOUT: "120" steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: ${{matrix.py_ver}} - - name: Validate version and release notes + - name: Build pip artifacts run: | DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) - RELEASE_BODY=$(python3 -c \ - 'print(open("./CHANGELOG.md").read().split("\n\n")[1].split("\n", 1)[1])' \ - ) echo "DJ_VERSION=${DJ_VERSION}" >> $GITHUB_ENV - echo "RELEASE_BODY<> $GITHUB_ENV - echo "$RELEASE_BODY" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - name: Build pip artifacts - run: | python3 -m pip install build python3 -m build . - echo "DJ_VERSION=${DJ_VERSION}" >> $GITHUB_ENV - - if: matrix.py_ver == '3.9' && matrix.distro == 'debian' - name: Add pip artifacts + - name: Add pip artifacts uses: actions/upload-artifact@v4 with: name: pip-datajoint-${{env.DJ_VERSION}} From 160d87c29c1736e1309d44375b79cab5a1138287 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Sat, 15 Mar 2025 00:06:24 -0500 Subject: [PATCH 12/25] =?UTF-8?q?build:=20=F0=9F=8E=A8=20pyproject=20dynam?= =?UTF-8?q?ically=20syncs=20from=20version.py=20|=20update=20optional=5Fde?= =?UTF-8?q?pendencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/devcontainer.json | 2 +- docs/src/develop.md | 2 +- pyproject.toml | 16 +++++++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3ef7f9b6e..9099347df 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -28,7 +28,7 @@ // "runServices": [], // Uncomment the next line if you want to keep your containers running after VS Code shuts down. "shutdownAction": "stopCompose", - "onCreateCommand": "python3 -m pip install -q -e .[test]", + "onCreateCommand": "python3 -m pip install -q -e .[dev]", "features": { "ghcr.io/devcontainers/features/git:1": {}, "ghcr.io/devcontainers/features/docker-in-docker:2": {}, diff --git a/docs/src/develop.md b/docs/src/develop.md index 5643623d5..4c66d52de 100644 --- a/docs/src/develop.md +++ b/docs/src/develop.md @@ -23,7 +23,7 @@ Here are some options that provide a great developer experience: - Ensure you have [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - Ensure you have [Docker](https://docs.docker.com/get-docker/) - `git clone` the codebase repository and open it in VSCode - - Issue the following command in the terminal to build and run the Docker container: `HOST_UID=$(id -u) PY_VER=3.11 DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) docker compose --profile test run --rm -it djtest -- sh -c 'pip install -qe ".[test]" && bash'` + - Issue the following command in the terminal to build and run the Docker container: `HOST_UID=$(id -u) PY_VER=3.11 DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) docker compose --profile test run --rm -it djtest -- sh -c 'pip install -qe ".[dev]" && bash'` - Issue the following command in the terminal to stop the Docker compose stack: `docker compose --profile test down` ## Features diff --git a/pyproject.toml b/pyproject.toml index bae73a923..0c33193a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "datajoint" -# should to be auto synced with datajoint/version.py:__version__ -version = "0.14.4" +# dynamically set in tools.setuptools.dynamic +dynamic = ["version"] dependencies = [ "numpy", "pymysql>=0.7.2", @@ -64,11 +64,18 @@ classifiers = [ [project.optional-dependencies] test = [ - "pre-commit", "pytest", "pytest-cov", +] +dev = [ + "pre-commit", "black==24.2.0", "flake8", + "isort", + "codespell", + # including test + "pytest", + "pytest-cov", ] [project.urls] @@ -85,6 +92,9 @@ datajoint = "datajoint.cli:cli" [tool.setuptools] packages = ["datajoint"] +[tool.setuptools.dynamic] +version = { attr = "datajoint.version.__version__"} + [build-system] requires = [ "setuptools>=60", From f484bf2b363c95b1f18b19bb06cddc03d4d31f90 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Sat, 15 Mar 2025 00:10:14 -0500 Subject: [PATCH 13/25] =?UTF-8?q?fix:=20=F0=9F=8E=A8=20reorganize=20tool.s?= =?UTF-8?q?etuptools=20in=20pyproject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0c33193a9..9fd0bf05f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,15 +89,15 @@ Repository = "https://github.com/datajoint/datajoint-python" dj = "datajoint.cli:cli" datajoint = "datajoint.cli:cli" -[tool.setuptools] -packages = ["datajoint"] - -[tool.setuptools.dynamic] -version = { attr = "datajoint.version.__version__"} - [build-system] requires = [ "setuptools>=60", "setuptools-scm>=8.0" ] build-backend = "setuptools.build_meta" + +[tool.setuptools] +packages = ["datajoint"] + +[tool.setuptools.dynamic] +version = { attr = "datajoint.version.__version__"} From 713dad05a64f88f354a9d2d01bd79b74193644ec Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Sat, 15 Mar 2025 02:10:10 -0500 Subject: [PATCH 14/25] =?UTF-8?q?ci:=20=F0=9F=8E=A8=20improve=20pyproject.?= =?UTF-8?q?toml=20and=20release=20flow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yaml | 110 +++++++++++---------------------- pyproject.toml | 35 ++++++----- 2 files changed, 54 insertions(+), 91 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b075b7bf7..fb80e4772 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,60 +2,55 @@ name: Release on: workflow_dispatch: jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - py_ver: ["3.9", "3.10", "3.11", "3.12", "3.13"] - env: - PY_VER: ${{matrix.py_ver}} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: ${{matrix.py_ver}} - - name: Build pip artifacts - run: | - DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) - echo "DJ_VERSION=${DJ_VERSION}" >> $GITHUB_ENV - python3 -m pip install build - python3 -m build . - - name: Add pip artifacts - uses: actions/upload-artifact@v4 - with: - name: pip-datajoint-${{env.DJ_VERSION}} - path: dist - retention-days: 1 - publish-release: - if: | - github.event_name == 'push' && - startsWith(github.ref, 'refs/tags') - needs: build + build-release: runs-on: ubuntu-latest strategy: matrix: include: - py_ver: "3.9" - distro: debian - image: djbase env: PY_VER: ${{matrix.py_ver}} - DISTRO: ${{matrix.distro}} - IMAGE: ${{matrix.image}} TWINE_USERNAME: ${{secrets.twine_username}} TWINE_PASSWORD: ${{secrets.twine_password}} - DOCKER_CLIENT_TIMEOUT: "120" - COMPOSE_HTTP_TIMEOUT: "120" - outputs: - release_upload_url: ${{steps.create_gh_release.outputs.upload_url}} steps: - uses: actions/checkout@v4 - name: Set up Python ${{matrix.py_ver}} uses: actions/setup-python@v5 with: python-version: ${{matrix.py_ver}} - - name: Determine package version + # Merging build and release steps just for the simplicity, + # since datajoint-python doesn't have platform specific dependencies or binaries, + # and the build process is fairly fast, so removed upload/download artifacts + - name: Build package + run: | + python -m pip install build + python -m build . + echo "DJ_WHEEL_PATH=$(ls dist/datajoint-*.whl)" >> $GITHUB_ENV + echo "DJ_SDIST_PATH=$(ls dist/datajoint-*.tar.gz)" >> $GITHUB_ENV + - name: Publish package + run: | + export HOST_UID=$(id -u) + docker compose run --build --quiet-pull \ + -e TWINE_USERNAME=${TWINE_USERNAME} -e TWINE_PASSWORD=${TWINE_PASSWORD} app \ + sh -c "pip install twine && python -m twine upload dist/*" + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{secrets.docker_username}} + password: ${{secrets.docker_password}} + - name: Publish image + run: | + IMAGE=$(docker images --filter "reference=datajoint/datajoint*" --format "{{.Repository}}") + TAG=$(docker images --filter "reference=datajoint/datajoint*" --format "{{.Tag}}") + docker push "${IMAGE}:${TAG}" + docker tag "${IMAGE}:${TAG}" "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}" + docker push "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}" + [ "$PY_VER" == "3.9" ] && [ "$DISTRO" == "debian" ] \ + && docker tag "${IMAGE}:${TAG}" "${IMAGE}:latest" \ + && docker push "${IMAGE}:latest" \ + || echo "skipping 'latest' tag..." + # Make sure all above release targets are done first, then make a GH release + - name: Make release notes run: | DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) RELEASE_BODY=$(python -c \ @@ -76,15 +71,7 @@ jobs: body: ${{env.RELEASE_BODY}} prerelease: false draft: false - - name: Fetch pip artifacts - uses: actions/download-artifact@v4 - with: - name: pip-datajoint-${{env.DJ_VERSION}} - path: dist - - name: Determine pip artifact paths - run: | - echo "DJ_WHEEL_PATH=$(ls dist/datajoint-*.whl)" >> $GITHUB_ENV - echo "DJ_SDIST_PATH=$(ls dist/datajoint-*.tar.gz)" >> $GITHUB_ENV + # Upload package as release assets - name: Upload pip wheel asset to release uses: actions/upload-release-asset@v1 env: @@ -103,34 +90,9 @@ jobs: asset_path: ${{env.DJ_SDIST_PATH}} asset_name: pip-datajoint-${{env.DJ_VERSION}}.tar.gz asset_content_type: application/gzip - - name: Publish pip release - run: | - export HOST_UID=$(id -u) - docker compose run --build --quiet-pull \ - -e TWINE_USERNAME=${TWINE_USERNAME} -e TWINE_PASSWORD=${TWINE_PASSWORD} app \ - sh -c "pip install twine && python -m twine upload dist/*" - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{secrets.docker_username}} - password: ${{secrets.docker_password}} - - name: Publish image - run: | - IMAGE=$(docker images --filter "reference=datajoint/datajoint*" --format "{{.Repository}}") - TAG=$(docker images --filter "reference=datajoint/datajoint*" --format "{{.Tag}}") - docker push "${IMAGE}:${TAG}" - docker tag "${IMAGE}:${TAG}" "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}" - docker push "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}" - [ "$PY_VER" == "3.9" ] && [ "$DISTRO" == "debian" ] \ - && docker tag "${IMAGE}:${TAG}" "${IMAGE}:latest" \ - && docker push "${IMAGE}:latest" \ - || echo "skipping 'latest' tag..." # only release docs when a release is published call-publish-docs: - if: | - github.event_name == 'push' && - startsWith(github.ref, 'refs/tags') - needs: publish-release + needs: build-release runs-on: ubuntu-latest steps: - uses: ./.github/workflows/docs.yaml diff --git a/pyproject.toml b/pyproject.toml index 9fd0bf05f..5668d2bd4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["setuptools>=60"] +build-backend = "setuptools.build_meta" + [project] name = "datajoint" # dynamically set in tools.setuptools.dynamic @@ -57,11 +61,23 @@ classifiers = [ "Intended Audience :: Science/Research", "Intended Audience :: Healthcare Industry", "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", + "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Bio-Informatics", "Topic :: Scientific/Engineering :: Neuroscience", # Not standard, but just in case ] +[project.urls] +Homepage = "https://datajoint.com/docs" +Documentation = "https://datajoint.com/docs" +Repository = "https://github.com/datajoint/datajoint-python" +"Bug Tracker" = "https://github.com/datajoint/datajoint-python/issues" +"Release Notes" = "https://github.com/datajoint/datajoint-python/releases" + +[project.entry-points."console_scripts"] +dj = "datajoint.cli:cli" +datajoint = "datajoint.cli:cli" + [project.optional-dependencies] test = [ "pytest", @@ -78,23 +94,8 @@ dev = [ "pytest-cov", ] -[project.urls] -Homepage = "https://datajoint.com/docs" -Documentation = "https://datajoint.com/docs" -Repository = "https://github.com/datajoint/datajoint-python" -"Bug Tracker" = "https://github.com/datajoint/datajoint-python/issues" -"Release Notes" = "https://github.com/datajoint/datajoint-python/releases" - -[project.entry-points."console_scripts"] -dj = "datajoint.cli:cli" -datajoint = "datajoint.cli:cli" - -[build-system] -requires = [ - "setuptools>=60", - "setuptools-scm>=8.0" -] -build-backend = "setuptools.build_meta" +[tool.isort] +profile = "black" [tool.setuptools] packages = ["datajoint"] From 912f4c9b0a8cdb1a403bc4f5cb2494f7e1e2b663 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Sat, 15 Mar 2025 02:26:26 -0500 Subject: [PATCH 15/25] =?UTF-8?q?ci:=20=F0=9F=8E=A8=20add=20release=20to?= =?UTF-8?q?=20testpypi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yaml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fb80e4772..4782c3829 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,6 +1,14 @@ name: Release on: workflow_dispatch: + inputs: + testpypi: + description: 'Release to TestPyPI then skip the rest' + default: 'false' + type: choice + options: + - 'true' + - 'false' jobs: build-release: runs-on: ubuntu-latest @@ -12,6 +20,7 @@ jobs: PY_VER: ${{matrix.py_ver}} TWINE_USERNAME: ${{secrets.twine_username}} TWINE_PASSWORD: ${{secrets.twine_password}} + TESTPYPI: ${{ github.event.inputs.testpypi }} steps: - uses: actions/checkout@v4 - name: Set up Python ${{matrix.py_ver}} @@ -30,15 +39,20 @@ jobs: - name: Publish package run: | export HOST_UID=$(id -u) + [ "$TESTPYPI" == "true" ] && export TWINE_REPOSITORY="testpypi" || export TWINE_REPOSITORY="pypi" docker compose run --build --quiet-pull \ - -e TWINE_USERNAME=${TWINE_USERNAME} -e TWINE_PASSWORD=${TWINE_PASSWORD} app \ - sh -c "pip install twine && python -m twine upload dist/*" + -e TWINE_USERNAME=${TWINE_USERNAME} \ + -e TWINE_PASSWORD=${TWINE_PASSWORD} \ + -e TWINE_REPOSITORY=${TWINE_REPOSITORY} \ + app sh -c "pip install twine && python -m twine upload dist/*" - name: Login to DockerHub + if: ${{ github.event.inputs.testpypi == 'false' }} uses: docker/login-action@v3 with: username: ${{secrets.docker_username}} password: ${{secrets.docker_password}} - name: Publish image + if: ${{ github.event.inputs.testpypi == 'false' }} run: | IMAGE=$(docker images --filter "reference=datajoint/datajoint*" --format "{{.Repository}}") TAG=$(docker images --filter "reference=datajoint/datajoint*" --format "{{.Tag}}") @@ -51,6 +65,7 @@ jobs: || echo "skipping 'latest' tag..." # Make sure all above release targets are done first, then make a GH release - name: Make release notes + if: ${{ github.event.inputs.testpypi == 'false' }} run: | DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) RELEASE_BODY=$(python -c \ @@ -61,6 +76,7 @@ jobs: echo "$RELEASE_BODY" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: Create GH release + if: ${{ github.event.inputs.testpypi == 'false' }} id: create_gh_release uses: actions/create-release@v1 env: @@ -73,6 +89,7 @@ jobs: draft: false # Upload package as release assets - name: Upload pip wheel asset to release + if: ${{ github.event.inputs.testpypi == 'false' }} uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} @@ -82,6 +99,7 @@ jobs: asset_name: pip-datajoint-${{env.DJ_VERSION}}.whl asset_content_type: application/zip - name: Upload pip sdist asset to release + if: ${{ github.event.inputs.testpypi == 'false' }} uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} @@ -92,6 +110,7 @@ jobs: asset_content_type: application/gzip # only release docs when a release is published call-publish-docs: + if: ${{ github.event.inputs.testpypi == 'false' }} needs: build-release runs-on: ubuntu-latest steps: From 3e62ad6e4d1c305c2abea5a7c9adcaa56f1332c6 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Sat, 15 Mar 2025 02:33:06 -0500 Subject: [PATCH 16/25] =?UTF-8?q?fix:=20=F0=9F=90=9B=20missing=20testpypi?= =?UTF-8?q?=20credentials?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4782c3829..b487fad7c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,6 +20,8 @@ jobs: PY_VER: ${{matrix.py_ver}} TWINE_USERNAME: ${{secrets.twine_username}} TWINE_PASSWORD: ${{secrets.twine_password}} + TWINE_TEST_USERNAME: ${{secrets.twine_test_username}} + TWINE_TEST_PASSWORD: ${{secrets.twine_test_password}} TESTPYPI: ${{ github.event.inputs.testpypi }} steps: - uses: actions/checkout@v4 @@ -39,7 +41,13 @@ jobs: - name: Publish package run: | export HOST_UID=$(id -u) - [ "$TESTPYPI" == "true" ] && export TWINE_REPOSITORY="testpypi" || export TWINE_REPOSITORY="pypi" + if [ "$TESTPYPI" == "true" ]; then + export TWINE_REPOSITORY="testpypi" + export TWINE_USERNAME=${TWINE_TEST_USERNAME} + export TWINE_PASSWORD=${TWINE_TEST_PASSWORD} + else + export TWINE_REPOSITORY="pypi" + fi docker compose run --build --quiet-pull \ -e TWINE_USERNAME=${TWINE_USERNAME} \ -e TWINE_PASSWORD=${TWINE_PASSWORD} \ From e56f29815fcb8c434922622f38eea8c45a0d8080 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Sat, 15 Mar 2025 02:37:08 -0500 Subject: [PATCH 17/25] =?UTF-8?q?fix:=20=F0=9F=90=9B=20indentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b487fad7c..1cc6d19bf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,14 +1,14 @@ name: Release on: workflow_dispatch: - inputs: - testpypi: - description: 'Release to TestPyPI then skip the rest' - default: 'false' - type: choice - options: - - 'true' - - 'false' + inputs: + testpypi: + description: 'Release to TestPyPI then skip the rest' + default: 'false' + type: choice + options: + - 'true' + - 'false' jobs: build-release: runs-on: ubuntu-latest From daac0326256369853f645828a0e20ff3ca8b639c Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Sat, 15 Mar 2025 02:46:08 -0500 Subject: [PATCH 18/25] =?UTF-8?q?feat:=20=E2=9C=A8=20add=20github=20action?= =?UTF-8?q?s=20lint=20pre-commit=20hook...=20This=20is=20so=20nice!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 426751d3c..caa54484f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -54,6 +54,10 @@ repos: - --statistics - --per-file-ignores=datajoint/diagram.py:C901 files: datajoint # a lot of files in tests are not compliant +- repo: https://github.com/rhysd/actionlint + rev: v1.7.7 + hooks: + - id: actionlint ## Suggest to add pytest hook that runs unit test | Prerequisite: split unit/integration test ## https://github.com/datajoint/datajoint-python/issues/1211 From 776e64a5ab35fed2b14cdfd648da876737532d0f Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Sat, 15 Mar 2025 02:46:38 -0500 Subject: [PATCH 19/25] =?UTF-8?q?fix:=20=F0=9F=8E=A8=20bump=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 94b26d242..07f143be2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,8 +14,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 # enforce the same check as pre-commit # but only run important checks - uses: pre-commit/action@v3.0.1 From 55b453a7a08e70e8421e15fbd9e08eeef8e3b618 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Sat, 15 Mar 2025 02:51:04 -0500 Subject: [PATCH 20/25] =?UTF-8?q?ci:=20=F0=9F=93=9D=20update=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yaml | 2 +- .pre-commit-config.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1cc6d19bf..0423444a6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,7 +3,7 @@ on: workflow_dispatch: inputs: testpypi: - description: 'Release to TestPyPI then skip the rest' + description: 'Release to TestPyPI then skip following flow' default: 'false' type: choice options: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index caa54484f..ed00405ad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -57,6 +57,7 @@ repos: - repo: https://github.com/rhysd/actionlint rev: v1.7.7 hooks: + # lint github actions workflow yaml - id: actionlint ## Suggest to add pytest hook that runs unit test | Prerequisite: split unit/integration test From 87244628eb52336f56f50d87f71f34d0a8760698 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Sat, 15 Mar 2025 03:07:55 -0500 Subject: [PATCH 21/25] =?UTF-8?q?ci:=20=E2=9A=A1=EF=B8=8F=20improve=20desc?= =?UTF-8?q?ription?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0423444a6..737096c62 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,7 +3,7 @@ on: workflow_dispatch: inputs: testpypi: - description: 'Release to TestPyPI then skip following flow' + description: 'Release to TestPyPI then skip following' default: 'false' type: choice options: From 9649071003d1c36aa2123c483d00698da71aa831 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Sat, 15 Mar 2025 03:32:37 -0500 Subject: [PATCH 22/25] =?UTF-8?q?build:=20=F0=9F=93=9D=20add=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 737096c62..ae848c310 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,6 +12,8 @@ on: jobs: build-release: runs-on: ubuntu-latest + # Use the oldest supported version to build, just in case there are issues + # for our case, this doesn't matter that much, since the build is for 3.x strategy: matrix: include: From 007652a26a1daf390c1cd7e65a5582dadd87911e Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Mon, 24 Mar 2025 03:08:42 -0500 Subject: [PATCH 23/25] =?UTF-8?q?fix:=20=F0=9F=94=A5=20remove=20white=20sp?= =?UTF-8?q?ace/end=20of=20file=20checks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ed00405ad..b8992481a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,8 +15,6 @@ repos: - id: check-json exclude: '(.vscode|.devcontainer)' # exclude these since // was used for comments - id: check-toml - - id: trailing-whitespace - - id: end-of-file-fixer - id: check-added-large-files - repo: https://github.com/codespell-project/codespell rev: v2.4.1 From a0fc4ea7b67ba8bf7fc82c7f76d622e17630b555 Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Mon, 24 Mar 2025 03:10:33 -0500 Subject: [PATCH 24/25] =?UTF-8?q?fix:=20=F0=9F=90=9B=20only=20run=20test?= =?UTF-8?q?=20on=20necessary=20file=20edits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 07f143be2..555f2bd5e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,11 +5,19 @@ on: - "**" # every branch - "!gh-pages" # exclude gh-pages branch - "!stage*" # exclude branches beginning with stage + paths: + - "datajoint" + - "tests" + - ".pre-commit-config.yaml" pull_request: branches: - "**" # every branch - "!gh-pages" # exclude gh-pages branch - "!stage*" # exclude branches beginning with stage + paths: + - "datajoint" + - "tests" + - ".pre-commit-config.yaml" jobs: lint: runs-on: ubuntu-latest From 0d0f50427a7f111787814d78c7f9f005f1a04c8b Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Mon, 24 Mar 2025 03:14:15 -0500 Subject: [PATCH 25/25] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20lint/test=20t?= =?UTF-8?q?rigger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lint.yaml | 29 +++++++++++++++++++++++++++++ .github/workflows/test.yaml | 19 ------------------- 2 files changed, 29 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 000000000..1b012f1f9 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,29 @@ +name: Test +on: + push: + branches: + - "**" # every branch + - "!gh-pages" # exclude gh-pages branch + - "!stage*" # exclude branches beginning with stage + pull_request: + branches: + - "**" # every branch + - "!gh-pages" # exclude gh-pages branch + - "!stage*" # exclude branches beginning with stage +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + # enforce the same check as pre-commit + # but only run important checks + - uses: pre-commit/action@v3.0.1 + with: + extra_args: codespell --all-files + - uses: pre-commit/action@v3.0.1 + with: + extra_args: black --all-files + - uses: pre-commit/action@v3.0.1 + with: + extra_args: flake8 --all-files diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 555f2bd5e..196ddec22 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,7 +8,6 @@ on: paths: - "datajoint" - "tests" - - ".pre-commit-config.yaml" pull_request: branches: - "**" # every branch @@ -17,27 +16,9 @@ on: paths: - "datajoint" - "tests" - - ".pre-commit-config.yaml" jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - # enforce the same check as pre-commit - # but only run important checks - - uses: pre-commit/action@v3.0.1 - with: - extra_args: codespell --all-files - - uses: pre-commit/action@v3.0.1 - with: - extra_args: black --all-files - - uses: pre-commit/action@v3.0.1 - with: - extra_args: flake8 --all-files test: runs-on: ubuntu-latest - needs: lint strategy: matrix: py_ver: ["3.9", "3.10", "3.11", "3.12", "3.13"]