From b371d41723beb1aacd1559240367c74804e8d50e Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Mon, 27 Jan 2020 21:30:47 +0200 Subject: [PATCH 01/12] Switch to setuptools_scm. --- axiom/_version.py | 1 - pyproject.toml | 6 ++++++ setup.py | 29 ----------------------------- 3 files changed, 6 insertions(+), 30 deletions(-) delete mode 100644 axiom/_version.py create mode 100644 pyproject.toml diff --git a/axiom/_version.py b/axiom/_version.py deleted file mode 100644 index ab55bb1a..00000000 --- a/axiom/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.7.5" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..ada22cfb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] + +[tool.setuptools_scm] +write_to = "axiom/_version.py" +write_to_template = "__version__ = \"{version}\"" diff --git a/setup.py b/setup.py index ea2f6dc6..6d56d487 100644 --- a/setup.py +++ b/setup.py @@ -1,33 +1,7 @@ from setuptools import setup, find_packages -from setuptools.command.install import install as Install -import re - -versionPattern = re.compile(r"""^__version__ = ['"](.*?)['"]$""", re.M) -with open("axiom/_version.py", "rt") as f: - version = versionPattern.search(f.read()).group(1) - - - -class InstallAndRegenerate(Install): - def run(self): - """ - Runs the usual install logic, then regenerates the plugin cache. - """ - Install.run(self) - _regenerateCache() - - - -def _regenerateCache(): - from twisted import plugin - from axiom import plugins - list(plugin.getPlugins(plugin.IPlugin)) # Twisted - list(plugin.getPlugins(plugin.IPlugin, plugins)) # Axiom - setup( name="Axiom", - version=version, description="An in-process object-relational database", url="https://github.com/twisted/axiom", @@ -43,9 +17,6 @@ def _regenerateCache(): }, packages=find_packages() + ['twisted.plugins'], scripts=['bin/axiomatic'], - cmdclass={ - "install": InstallAndRegenerate, - }, include_package_data=True, license="MIT", From a2939e00af698c0376fb6984815dc4774c441aba Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Mon, 27 Jan 2020 21:34:30 +0200 Subject: [PATCH 02/12] Set up automated publishing. --- .github/workflows/publish.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..a69fb942 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '2.7' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* From b0ecc64c38907117d29bf780cc6cbce58ec32e70 Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Mon, 27 Jan 2020 21:38:47 +0200 Subject: [PATCH 03/12] Ignore. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 2ae565a1..97d83516 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ apidocs/ *.egg-info/ .coverage .hypothesis/ +/axiom/_version.py +/coverage.xml From 48da7af4402d3c8239f804e935af54d86e936186 Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Mon, 27 Jan 2020 21:51:14 +0200 Subject: [PATCH 04/12] Fix Twisted version. --- axiom/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/axiom/__init__.py b/axiom/__init__.py index 986e4ae9..a25b70ae 100644 --- a/axiom/__init__.py +++ b/axiom/__init__.py @@ -3,6 +3,6 @@ from twisted.python import versions def asTwistedVersion(packageName, versionString): - return versions.Version(packageName, *map(int, versionString.split("."))) + return versions.Version(packageName, *map(int, versionString.split(".")[:3])) version = asTwistedVersion("axiom", __version__) From 703b9027e3dcde1095dec0166c1d69d2e1c37b8b Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Mon, 27 Jan 2020 22:05:16 +0200 Subject: [PATCH 05/12] Fix tox. --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6d56d487..69b616de 100644 --- a/setup.py +++ b/setup.py @@ -19,6 +19,9 @@ scripts=['bin/axiomatic'], include_package_data=True, + use_scm_version=True, + setup_requires=['setuptools_scm'], + license="MIT", platforms=["any"], @@ -29,7 +32,6 @@ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 2 :: Only", "Topic :: Database"]) From 8c1de4701b48f730987c691935ff3118608d6118 Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Tue, 28 Jan 2020 09:44:29 +0200 Subject: [PATCH 06/12] Fetch tags. --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4bb671e6..51f96537 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,8 @@ jobs: twisted: [twtrunk, twlatest, tw150] steps: - uses: actions/checkout@v2 + - name: Fetch tags + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - name: Setup Python uses: actions/setup-python@v1 with: From 9ea669be0203449cb914cba2db9c8b67ae368339 Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Tue, 28 Jan 2020 09:45:31 +0200 Subject: [PATCH 07/12] Back this out. --- setup.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.py b/setup.py index 69b616de..b8316831 100644 --- a/setup.py +++ b/setup.py @@ -19,9 +19,6 @@ scripts=['bin/axiomatic'], include_package_data=True, - use_scm_version=True, - setup_requires=['setuptools_scm'], - license="MIT", platforms=["any"], From 2c5f3a361f3deb4b315a2283d5859d8943e8fcda Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Tue, 28 Jan 2020 10:00:55 +0200 Subject: [PATCH 08/12] Really fix stuff? --- pyproject.toml | 1 + tox.ini | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ada22cfb..d95a40ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,6 @@ [build-system] requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] +build-backend = "setuptools.build_meta" [tool.setuptools_scm] write_to = "axiom/_version.py" diff --git a/tox.ini b/tox.ini index c155b612..35934be3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,13 @@ [tox] -envlist = {py27,pypy}-{twtrunk,twlatest,tw150} +envlist = {py27,pypy}-{twtrunk,twlatest,twlowest +isolated_build = True [testenv] +extras = test deps = - .[test] twlatest: Twisted twtrunk: https://github.com/twisted/twisted/archive/trunk.zip - tw150: Twisted==15.0 + twlowest: Twisted==16.0 coverage commands = coverage run --source {envsitepackagesdir}/axiom/ --branch \ From a8c29795763f3f55c0afdfd8a8c894bdedf11bda Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Tue, 28 Jan 2020 10:19:40 +0200 Subject: [PATCH 09/12] Try again. --- .github/workflows/main.yml | 2 ++ .github/workflows/publish.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 51f96537..36137350 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,8 @@ jobs: twisted: [twtrunk, twlatest, tw150] steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Fetch tags run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - name: Setup Python diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a69fb942..8510c199 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,6 +9,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + with: + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v1 with: From 46cca4c8979b40faddd5536df80e988608b7ac54 Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Tue, 28 Jan 2020 10:22:45 +0200 Subject: [PATCH 10/12] Oops. --- .github/workflows/main.yml | 2 +- .github/workflows/publish.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 36137350..2adb2230 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: python: [2.7, pypy2] - twisted: [twtrunk, twlatest, tw150] + twisted: [twtrunk, twlatest, twlowest] steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8510c199..02edbb96 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,6 +11,8 @@ jobs: - uses: actions/checkout@v1 with: fetch-depth: 0 + - name: Fetch tags + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - name: Set up Python uses: actions/setup-python@v1 with: From 53869434b706a7a31543b2687efaddd1ef8b8f8a Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Tue, 28 Jan 2020 10:59:01 +0200 Subject: [PATCH 11/12] More fixes. --- MANIFEST.in | 8 +++----- setup.py | 2 ++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index bf0c5425..8b41a212 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,3 @@ -include LICENSE -include NAME.txt -recursive-include axiom/test/historic *.tbz2 -include axiom/batch.tac -graft axiom/examples +prune .github +prune benchmark +global-exclude .* diff --git a/setup.py b/setup.py index b8316831..55ec4a01 100644 --- a/setup.py +++ b/setup.py @@ -8,6 +8,8 @@ maintainer="Divmod, Inc.", maintainer_email="support@divmod.org", + use_scm_version=True, + setup_requires=['setuptools_scm'], install_requires=[ "Twisted>=13.2.0", "Epsilon>=0.7.0" From e21d325c7fde85216de7a0d31d4407ededac57ad Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Tue, 28 Jan 2020 11:16:48 +0200 Subject: [PATCH 12/12] Name codecov reports. --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2adb2230..7a7962ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,3 +33,4 @@ jobs: uses: codecov/codecov-action@v1.0.5 with: token: ${{ secrets.CODECOV_TOKEN }} + name: gh-${{ matrix.python }}-${{ matrix.twisted }}