From 7d9f393c17af488006d3c147b7a96babb63f4493 Mon Sep 17 00:00:00 2001 From: Moshe Zadka Date: Thu, 11 Jan 2024 00:02:37 +0000 Subject: [PATCH 1/3] checkpoint --- .github/workflows/pr-main.yml | 2 +- requirements-tests.txt | 2 +- src/gather/api.py | 18 ++---------------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pr-main.yml b/.github/workflows/pr-main.yml index c76e2de..e4adbef 100644 --- a/.github/workflows/pr-main.yml +++ b/.github/workflows/pr-main.yml @@ -8,7 +8,7 @@ jobs: matrix: include: - { python: "3.11", os: ubuntu-latest, check: "tests-3.11" } - #- { python: "3.12", os: ubuntu-latest, check: "tests-3.12" } + - { python: "3.12", os: ubuntu-latest, check: "tests-3.12" } - { python: "3.11", os: ubuntu-latest, check: "lint" } - { python: "3.11", os: ubuntu-latest, check: "docs" } - { python: "3.11", os: ubuntu-latest, check: "mypy" } diff --git a/requirements-tests.txt b/requirements-tests.txt index d23a276..a89a6f5 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -40,7 +40,7 @@ twisted==22.4.0 # via virtue typing-extensions==4.3.0 # via twisted -venusian==3.0.0 +venusian==3.1.0 # via gather (pyproject.toml) virtue==2.1.1 # via gather (pyproject.toml) diff --git a/src/gather/api.py b/src/gather/api.py index a7a8632..c799bce 100644 --- a/src/gather/api.py +++ b/src/gather/api.py @@ -35,20 +35,8 @@ import venusian -@contextlib.contextmanager -def _ignore_deprecation(): - warnings.filterwarnings(action="ignore", category=DeprecationWarning) - try: - yield - finally: - warnings.filters.pop(0) - - def _get_modules(): - eps = importlib.metadata.entry_points() - with _ignore_deprecation(): - gather_points = eps["gather"] - for entry_point in gather_points: + for entry_point in importlib.metadata.entry_points(name="gather"): module = importlib.import_module(entry_point.value) yield module @@ -137,9 +125,7 @@ def ignore_import_error(_unused): registry = collections.defaultdict(set) scanner = venusian.Scanner(registry=registry, tag=self) for module in _get_modules(): - # Venusian is using a newly-deprecated method to scan modules - with _ignore_deprecation(): - scanner.scan(module, onerror=ignore_import_error) + scanner.scan(module, onerror=ignore_import_error) return registry From 35f41e5b6c28ebb0b20a8c964b9bef45d9b18539 Mon Sep 17 00:00:00 2001 From: Moshe Zadka Date: Thu, 11 Jan 2024 01:17:54 +0000 Subject: [PATCH 2/3] checkpoint --- requirements-docs.txt | 54 ++++++++++++++++++++++-------------------- requirements-lint.txt | 43 +++++++++++++++------------------ requirements-mypy.txt | 12 +++++----- requirements-tests.txt | 28 +++++++++++----------- 4 files changed, 67 insertions(+), 70 deletions(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index e27e465..03556bc 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -4,57 +4,59 @@ # # pip-compile --extra=docs --output-file=requirements-docs.txt pyproject.toml # -alabaster==0.7.12 +alabaster==0.7.16 # via sphinx -attrs==21.4.0 +attrs==23.2.0 # via gather (pyproject.toml) -babel==2.10.3 +babel==2.14.0 # via sphinx -certifi==2022.6.15 +certifi==2023.11.17 # via requests -charset-normalizer==2.1.0 +charset-normalizer==3.3.2 # via requests -docutils==0.18.1 +docutils==0.20.1 # via sphinx -idna==3.3 +idna==3.6 # via requests imagesize==1.4.1 # via sphinx -incremental==21.3.0 +incremental==22.10.0 # via gather (pyproject.toml) -jinja2==3.1.2 +jinja2==3.1.3 # via sphinx -markupsafe==2.1.1 +markupsafe==2.1.3 # via jinja2 -packaging==21.3 +packaging==23.2 # via sphinx -pygments==2.12.0 +pygments==2.17.2 # via sphinx -pyparsing==3.0.9 - # via packaging -pytz==2022.1 - # via babel -requests==2.28.1 +requests==2.31.0 # via sphinx snowballstemmer==2.2.0 # via sphinx -sphinx==5.0.2 - # via gather (pyproject.toml) -sphinxcontrib-applehelp==1.0.2 +sphinx==7.2.6 + # via + # gather (pyproject.toml) + # sphinxcontrib-applehelp + # sphinxcontrib-devhelp + # sphinxcontrib-htmlhelp + # sphinxcontrib-qthelp + # sphinxcontrib-serializinghtml +sphinxcontrib-applehelp==1.0.7 # via sphinx -sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-devhelp==1.0.5 # via sphinx -sphinxcontrib-htmlhelp==2.0.0 +sphinxcontrib-htmlhelp==2.0.4 # via sphinx sphinxcontrib-jsmath==1.0.1 # via sphinx -sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-qthelp==1.0.6 # via sphinx -sphinxcontrib-serializinghtml==1.1.5 +sphinxcontrib-serializinghtml==1.1.9 # via sphinx toolz==0.12.0 # via gather (pyproject.toml) -urllib3==1.26.9 +urllib3==2.1.0 # via requests -venusian==3.0.0 +venusian==3.1.0 # via gather (pyproject.toml) diff --git a/requirements-lint.txt b/requirements-lint.txt index b6b1bd7..abe4d03 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -4,50 +4,45 @@ # # pip-compile --extra=lint --output-file=requirements-lint.txt pyproject.toml # -astroid==2.11.6 +astroid==3.0.2 # via pylint -attrs==21.4.0 +attrs==23.2.0 # via gather (pyproject.toml) -black==22.6.0 +black==23.12.1 # via gather (pyproject.toml) -click==8.1.3 +click==8.1.7 # via black -dill==0.3.5.1 +dill==0.3.7 # via pylint -flake8==4.0.1 +flake8==7.0.0 # via gather (pyproject.toml) -incremental==21.3.0 +incremental==22.10.0 # via gather (pyproject.toml) -isort==5.10.1 +isort==5.13.2 # via pylint -lazy-object-proxy==1.7.1 - # via astroid -mccabe==0.6.1 +mccabe==0.7.0 # via # flake8 # pylint -mypy-extensions==0.4.3 +mypy-extensions==1.0.0 # via black -pathspec==0.9.0 +packaging==23.2 # via black -platformdirs==2.5.2 +pathspec==0.12.1 + # via black +platformdirs==4.1.0 # via # black # pylint -pycodestyle==2.8.0 +pycodestyle==2.11.1 # via flake8 -pyflakes==2.4.0 +pyflakes==3.2.0 # via flake8 -pylint==2.14.4 +pylint==3.0.3 # via gather (pyproject.toml) -tomlkit==0.11.0 +tomlkit==0.12.3 # via pylint toolz==0.12.0 # via gather (pyproject.toml) -venusian==3.0.0 +venusian==3.1.0 # via gather (pyproject.toml) -wrapt==1.14.1 - # via astroid - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/requirements-mypy.txt b/requirements-mypy.txt index c760436..d81c5d1 100644 --- a/requirements-mypy.txt +++ b/requirements-mypy.txt @@ -4,17 +4,17 @@ # # pip-compile --extra=mypy --output-file=requirements-mypy.txt pyproject.toml # -attrs==21.4.0 +attrs==23.2.0 # via gather (pyproject.toml) -incremental==21.3.0 +incremental==22.10.0 # via gather (pyproject.toml) -mypy==0.961 +mypy==1.8.0 # via gather (pyproject.toml) -mypy-extensions==0.4.3 +mypy-extensions==1.0.0 # via mypy toolz==0.12.0 # via gather (pyproject.toml) -typing-extensions==4.3.0 +typing-extensions==4.9.0 # via mypy -venusian==3.0.0 +venusian==3.1.0 # via gather (pyproject.toml) diff --git a/requirements-tests.txt b/requirements-tests.txt index a89a6f5..d6552f4 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -4,47 +4,47 @@ # # pip-compile --extra=tests --output-file=requirements-tests.txt pyproject.toml # -attrs==21.4.0 +attrs==23.2.0 # via # automat # gather (pyproject.toml) # twisted # virtue -automat==20.2.0 +automat==22.10.0 # via twisted -click==8.1.3 +click==8.1.7 # via virtue -colorama==0.4.5 +colorama==0.4.6 # via virtue -constantly==15.1.0 +constantly==23.10.4 # via twisted -coverage[toml]==6.4.1 +coverage[toml]==7.4.0 # via gather (pyproject.toml) hyperlink==21.0.0 # via twisted -idna==3.3 +idna==3.6 # via hyperlink -incremental==21.3.0 +incremental==22.10.0 # via # gather (pyproject.toml) # twisted -pyhamcrest==2.0.3 +pyhamcrest==2.1.0 # via gather (pyproject.toml) -pyrsistent==0.18.1 +pyrsistent==0.20.0 # via virtue six==1.16.0 # via automat toolz==0.12.0 # via gather (pyproject.toml) -twisted==22.4.0 +twisted==23.10.0 # via virtue -typing-extensions==4.3.0 +typing-extensions==4.9.0 # via twisted venusian==3.1.0 # via gather (pyproject.toml) -virtue==2.1.1 +virtue==2023.8.2 # via gather (pyproject.toml) -zope-interface==5.4.0 +zope-interface==6.1 # via twisted # The following packages are considered to be unsafe in a requirements file: From fde4c6c5496525746501ce02181df00b5a174558 Mon Sep 17 00:00:00 2001 From: Moshe Zadka Date: Thu, 11 Jan 2024 15:54:44 +0000 Subject: [PATCH 3/3] checkpoint --- .github/workflows/release.yml | 55 +++++++++++++++++++++++++++++++++++ git-log-head | 5 ++++ pyproject.toml | 11 +++++-- src/gather/api.py | 2 -- 4 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 git-log-head diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..fc22ee0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +name: Release + +on: + push: + branches: + - master + +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + +jobs: + build: + name: Build + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + + - uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b + with: + python-version: "3.x" + cache: "pip" + cache-dependency-path: pyproject.toml + + - name: deps + run: python -m pip install -U build + + - name: env + run: env + + - name: build + run: python -m build + + - name: Upload built packages + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: built-packages + path: ./dist/ + if-no-files-found: warn + + release-pypi: + needs: build + runs-on: ubuntu-latest + permissions: + # Used to authenticate to PyPI via OIDC. + id-token: write + steps: + - name: Download artifacts directories # goes to current working directory + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + + - name: publish + uses: pypa/gh-action-pypi-publish@0bf742be3ebe032c25dd15117957dc15d0cfc38d + with: + packages_dir: built-packages/ diff --git a/git-log-head b/git-log-head new file mode 100644 index 0000000..66571d9 --- /dev/null +++ b/git-log-head @@ -0,0 +1,5 @@ +commit 35f41e5b6c28ebb0b20a8c964b9bef45d9b18539 +Author: Moshe Zadka +Date: 2024-01-11 01:17:54 +0000 + + checkpoint diff --git a/pyproject.toml b/pyproject.toml index e1960ac..25ed4df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [build-system] requires = [ - "setuptools" + "setuptools", "autocalver" ] build-backend = "setuptools.build_meta" [project] name = "gather" -version = "2024.1.5.3" +dynamic = ["version"] description = "A gatherer" readme = "README.rst" authors = [{name = "Moshe Zadka", email = "moshez@zadka.club"}] @@ -48,5 +48,12 @@ Development = "https://github.com/elcaminoreal/gather" Documentation = "https://gather.readthedocs.io/en/latest/" Blog = "https://gather.works" +[tool.autocalver] +use = true +log = "git-log-head" +log_command = "git log -n 1 --date=iso" +is_main_var = "GITHUB_REF" +is_main_match = ".*/trunk$" + [project.entry-points.gather] gather = "gather" diff --git a/src/gather/api.py b/src/gather/api.py index c799bce..119f938 100644 --- a/src/gather/api.py +++ b/src/gather/api.py @@ -26,10 +26,8 @@ Gather can be used to collect anything. """ import collections -import contextlib import importlib.metadata import sys -import warnings import attr import venusian