-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from twisted/use-ss
Switch to setuptools_scm
- Loading branch information
Showing
9 changed files
with
55 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,13 @@ jobs: | |
strategy: | ||
matrix: | ||
python: [2.7, pypy2] | ||
twisted: [twtrunk, twlatest, tw150] | ||
twisted: [twtrunk, twlatest, twlowest] | ||
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 | ||
uses: actions/setup-python@v1 | ||
with: | ||
|
@@ -29,3 +33,4 @@ jobs: | |
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
name: gh-${{ matrix.python }}-${{ matrix.twisted }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- 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: | ||
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/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ apidocs/ | |
*.egg-info/ | ||
.coverage | ||
.hypothesis/ | ||
/axiom/_version.py | ||
/coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 .* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[build-system] | ||
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools_scm] | ||
write_to = "axiom/_version.py" | ||
write_to_template = "__version__ = \"{version}\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,15 @@ | ||
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", | ||
|
||
maintainer="Divmod, Inc.", | ||
maintainer_email="[email protected]", | ||
|
||
use_scm_version=True, | ||
setup_requires=['setuptools_scm'], | ||
install_requires=[ | ||
"Twisted>=13.2.0", | ||
"Epsilon>=0.7.0" | ||
|
@@ -43,9 +19,6 @@ def _regenerateCache(): | |
}, | ||
packages=find_packages() + ['twisted.plugins'], | ||
scripts=['bin/axiomatic'], | ||
cmdclass={ | ||
"install": InstallAndRegenerate, | ||
}, | ||
include_package_data=True, | ||
|
||
license="MIT", | ||
|
@@ -58,7 +31,6 @@ def _regenerateCache(): | |
"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"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters