From 021b18b89cf83977397350ebe54603032086baf6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 27 Mar 2018 15:57:25 -0400 Subject: Bump minimum pytest version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c5ad4b1..6221124 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ params = dict( extras_require={ 'testing': [ # upstream - 'pytest>=2.8', + 'pytest>=3.5', 'pytest-sugar>=0.9.1', 'collective.checkdocs', 'pytest-flake8', -- cgit v1.2.1 From e302df43fc90a3db2bc9119c9e0dad08a754c0f5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 10 Apr 2018 09:19:48 -0400 Subject: Add pyproject.toml declaring build dependencies. --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3ef243c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[build-system] +requires = ["setuptools", "wheel", "setuptools_scm>=1.15"] -- cgit v1.2.1 From 9f06de212eb53c35ea52781796c58761fcd06de3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 12 Apr 2018 11:36:04 -0400 Subject: When ignoring linter warnings, document the reason. --- .flake8 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index e9955e7..df5f527 100644 --- a/.flake8 +++ b/.flake8 @@ -1,2 +1,6 @@ [flake8] -ignore = W191,W503 +ignore = + # Allow tabs for indentation + W191 + # W503 violates spec https://github.com/PyCQA/pycodestyle/issues/513 + W503 -- cgit v1.2.1 From 53c017416d74f96c49fde361c0a5b774ceac00c6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 9 Jun 2018 15:31:39 -0400 Subject: Disable the (broken) IPv6 in Travis. Ref travis-ci/travis-ci#8361. --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 85540ec..e22ab6f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,4 +31,9 @@ cache: pip install: - pip install tox tox-venv +before_script: + # Disable IPv6. Ref travis-ci/travis-ci#8361 + - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then + sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'; + fi script: tox -- cgit v1.2.1 From a4bdfe7caddd6b1bf4149f2d02adee727168ff8a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 11 Jun 2018 08:59:18 -0400 Subject: Don't match issues if preceeded by some other indicator. --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 14744ee..aeda56c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,7 +16,7 @@ link_files = { ), replace=[ dict( - pattern=r'(Issue )?#(?P\d+)', + pattern=r'(Issue #|\B#)(?P\d+)', url='{package_url}/issues/{issue}', ), dict( -- cgit v1.2.1 From 7c9ad053c3ef0b66cc71431fb619da8e3a12bc26 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 14 Jun 2018 08:25:24 -0400 Subject: skip_upload_docs is default --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e22ab6f..2560fc3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,6 @@ jobs: secure: ... # encrypt password with `travis encrypt` distributions: dists skip_cleanup: true - skip_upload_docs: true cache: pip -- cgit v1.2.1 From 67c79e3182614e96fd4cf3a4813932b1edeff262 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 14 Jun 2018 12:23:57 -0400 Subject: Drop the dot; http://blog.pytest.org/2016/whats-new-in-pytest-30/ --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index c2bac45..c6c14f0 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ deps = # workaround for yaml/pyyaml#126 # git+https://github.com/yaml/pyyaml@master#egg=pyyaml;python_version=="3.7" commands = - py.test {posargs} + pytest {posargs} python setup.py checkdocs usedevelop = True extras = testing -- cgit v1.2.1 From 440adac3c3f91519a1ff47114774dbd1d5baf676 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 14 Jun 2018 15:09:33 -0400 Subject: Rely on declarative config to create long_description. --- pyproject.toml | 2 +- setup.cfg | 1 + setup.py | 6 ------ 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3ef243c..1af54cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,2 @@ [build-system] -requires = ["setuptools", "wheel", "setuptools_scm>=1.15"] +requires = ["setuptools>=30.3", "wheel", "setuptools_scm>=1.15"] diff --git a/setup.cfg b/setup.cfg index 378a8e4..ff90351 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,3 +7,4 @@ universal = 1 [metadata] license_file = LICENSE +long_description = file:README.rst diff --git a/setup.py b/setup.py index 6221124..4afc628 100644 --- a/setup.py +++ b/setup.py @@ -2,13 +2,8 @@ # Project skeleton maintained at https://github.com/jaraco/skeleton -import io - import setuptools -with io.open('README.rst', encoding='utf-8') as readme: - long_description = readme.read() - name = 'skeleton' description = '' nspkg_technique = 'native' @@ -23,7 +18,6 @@ params = dict( author="Jason R. Coombs", author_email="jaraco@jaraco.com", description=description or name, - long_description=long_description, url="https://github.com/jaraco/" + name, packages=setuptools.find_packages(), include_package_data=True, -- cgit v1.2.1 From 15024f12b5d4e90aee4f9a780efa263f47865d96 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 27 Jun 2018 21:34:07 -0400 Subject: Remove workaround for pyyaml 126. --- tox.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/tox.ini b/tox.ini index c6c14f0..41e20a3 100644 --- a/tox.ini +++ b/tox.ini @@ -5,8 +5,6 @@ minversion = 2.4 [testenv] deps = setuptools>=31.0.1 - # workaround for yaml/pyyaml#126 - # git+https://github.com/yaml/pyyaml@master#egg=pyyaml;python_version=="3.7" commands = pytest {posargs} python setup.py checkdocs -- cgit v1.2.1 From f8462db925cbfa2ca0721c84376c23026633a730 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 3 Jul 2018 11:13:00 -0400 Subject: Revert "Remove workaround for pyyaml 126." This reverts commit 15024f12b5d4e90aee4f9a780efa263f47865d96. --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index 41e20a3..c6c14f0 100644 --- a/tox.ini +++ b/tox.ini @@ -5,6 +5,8 @@ minversion = 2.4 [testenv] deps = setuptools>=31.0.1 + # workaround for yaml/pyyaml#126 + # git+https://github.com/yaml/pyyaml@master#egg=pyyaml;python_version=="3.7" commands = pytest {posargs} python setup.py checkdocs -- cgit v1.2.1 From ed475c925d31ec146979f12b0ebf1e1021335e31 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 3 Jul 2018 11:15:33 -0400 Subject: We're getting close, but Python 3.7 still requires a workaround --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index c6c14f0..5925d3e 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ minversion = 2.4 deps = setuptools>=31.0.1 # workaround for yaml/pyyaml#126 - # git+https://github.com/yaml/pyyaml@master#egg=pyyaml;python_version=="3.7" + # pyyaml>=4.2b2;python_version=="3.7" commands = pytest {posargs} python setup.py checkdocs -- cgit v1.2.1 From beb0e0eb774dd15e79574ace338b885101d86d4b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 8 Aug 2018 15:14:55 -0400 Subject: Use xenial to include support for Python 3.7. --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2560fc3..b54e8e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,11 @@ -dist: trusty +dist: xenial sudo: false language: python python: - 2.7 -- &latest_py3 3.6 +- 3.6 +- &latest_py3 3.7 jobs: fast_finish: true -- cgit v1.2.1 From 5d245bb8ca22194dbf17e69f7db5f082101f931c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 20 Aug 2018 17:15:48 -0400 Subject: Remove release, no longer needed. Use twine instead. --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index ff90351..8fdad4f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,4 @@ [aliases] -release = dists upload dists = clean --all sdist bdist_wheel [bdist_wheel] -- cgit v1.2.1 From bf8c57034ab857eb5b642fbc137a811276e8067a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 20 Aug 2018 17:17:12 -0400 Subject: Also ignore W504 in flake8, following the indication in OCA/maintainer-quality-tools that neither W503 nor W504 are worthwhile in general. --- .flake8 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.flake8 b/.flake8 index df5f527..c85d34a 100644 --- a/.flake8 +++ b/.flake8 @@ -4,3 +4,5 @@ ignore = W191 # W503 violates spec https://github.com/PyCQA/pycodestyle/issues/513 W503 + # W504 has issues https://github.com/OCA/maintainer-quality-tools/issues/545 + W504 -- cgit v1.2.1 From 8cd0459a9012ad5070c5b2364d9835653e6d58b7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 28 Aug 2018 08:54:42 -0400 Subject: Release of pyyaml 3.13 seems to have fixed install issues on Python 3.7. --- tox.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/tox.ini b/tox.ini index 5925d3e..41e20a3 100644 --- a/tox.ini +++ b/tox.ini @@ -5,8 +5,6 @@ minversion = 2.4 [testenv] deps = setuptools>=31.0.1 - # workaround for yaml/pyyaml#126 - # pyyaml>=4.2b2;python_version=="3.7" commands = pytest {posargs} python setup.py checkdocs -- cgit v1.2.1 From 5633116de34f53c892d1f2c6d0f7de14c965cfa7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 28 Aug 2018 12:59:25 -0400 Subject: Block pytest 3.7.3 due to pytest-dev/pytest#3888. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4afc628..ba0fb89 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ params = dict( extras_require={ 'testing': [ # upstream - 'pytest>=3.5', + 'pytest>=3.5,!=3.7.3', 'pytest-sugar>=0.9.1', 'collective.checkdocs', 'pytest-flake8', -- cgit v1.2.1 From 9cdf6ef1f4401b1ec4b032f1b61c0f4f7fd78b8d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 17 Sep 2018 10:08:54 -0400 Subject: Move most package config to declarative config --- setup.cfg | 38 ++++++++++++++++++++++++++++++++++++++ setup.py | 58 +--------------------------------------------------------- 2 files changed, 39 insertions(+), 57 deletions(-) diff --git a/setup.cfg b/setup.cfg index 8fdad4f..adaed86 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,4 +6,42 @@ universal = 1 [metadata] license_file = LICENSE +name = skeleton +author = Jason R. Coombs +author_email = jaraco@jaraco.com +description = skeleton long_description = file:README.rst +url = https://github.com/jaraco/skeleton +classifiers = + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + +[options] +packages = find: +include_package_data = true +python_requires = >=2.7 +install_requires = +setup_requires = setuptools_scm >= 1.15.0 + +[options.extras_require] +testing = + # upstream + pytest >= 3.5, !=3.7.3 + pytest-sugar >= 0.9.1 + collective.checkdocs + pytest-flake8 + + # local + +docs = + # upstream + sphinx + jaraco.packaging >= 3.2 + rst.linker >= 1.9 + + # local + +[options.entry_points] diff --git a/setup.py b/setup.py index ba0fb89..c990c52 100644 --- a/setup.py +++ b/setup.py @@ -4,61 +4,5 @@ import setuptools -name = 'skeleton' -description = '' -nspkg_technique = 'native' -""" -Does this package use "native" namespace packages or -pkg_resources "managed" namespace packages? -""" - -params = dict( - name=name, - use_scm_version=True, - author="Jason R. Coombs", - author_email="jaraco@jaraco.com", - description=description or name, - url="https://github.com/jaraco/" + name, - packages=setuptools.find_packages(), - include_package_data=True, - namespace_packages=( - name.split('.')[:-1] if nspkg_technique == 'managed' - else [] - ), - python_requires='>=2.7', - install_requires=[ - ], - extras_require={ - 'testing': [ - # upstream - 'pytest>=3.5,!=3.7.3', - 'pytest-sugar>=0.9.1', - 'collective.checkdocs', - 'pytest-flake8', - - # local - ], - 'docs': [ - # upstream - 'sphinx', - 'jaraco.packaging>=3.2', - 'rst.linker>=1.9', - - # local - ], - }, - setup_requires=[ - 'setuptools_scm>=1.15.0', - ], - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - ], - entry_points={ - }, -) if __name__ == '__main__': - setuptools.setup(**params) + setuptools.setup(use_scm_version=True) -- cgit v1.2.1 From f8a537f300727a87c1a4a663a5df8b6e05e1020d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 19 Sep 2018 22:31:38 -0400 Subject: Ignore pycodestyle warning. Seems it's not going to be fixed anytime soon. --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest.ini b/pytest.ini index 0ba22c3..d0ba39d 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,3 +2,5 @@ norecursedirs=dist build .tox .eggs addopts=--doctest-modules --flake8 doctest_optionflags=ALLOW_UNICODE ELLIPSIS +filterwarnings= + ignore:Possible nested set::pycodestyle:113 -- cgit v1.2.1 From 106c755f83d701003afca33e0ba22c20c3a31c97 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 24 Sep 2018 18:08:59 -0400 Subject: Also ignore flake8 error --- pytest.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/pytest.ini b/pytest.ini index d0ba39d..61dab3d 100644 --- a/pytest.ini +++ b/pytest.ini @@ -4,3 +4,4 @@ addopts=--doctest-modules --flake8 doctest_optionflags=ALLOW_UNICODE ELLIPSIS filterwarnings= ignore:Possible nested set::pycodestyle:113 + ignore:Using or importing the ABCs::flake8:410 -- cgit v1.2.1 From 59cceeb35bd1005a16bd9985e623b10c82527e58 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 28 Oct 2018 23:24:08 -0400 Subject: Require setuptools 34.4 to support python_requires in declarative config. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1af54cb..65d7426 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,2 @@ [build-system] -requires = ["setuptools>=30.3", "wheel", "setuptools_scm>=1.15"] +requires = ["setuptools>=34.4", "wheel", "setuptools_scm>=1.15"] -- cgit v1.2.1 From 166b43e1429fa1b9b467da82109151222719cc20 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 7 Nov 2018 17:47:20 -0500 Subject: Add workaround for Frozenball/pytest-sugar#159. --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 41e20a3..78cc7f9 100644 --- a/tox.ini +++ b/tox.ini @@ -5,6 +5,7 @@ minversion = 2.4 [testenv] deps = setuptools>=31.0.1 + pytest-sugar-bugfix159 commands = pytest {posargs} python setup.py checkdocs -- cgit v1.2.1 From 8a08fefa8561407bee150a7e6c0c9d5117ac5e7b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 12 Nov 2018 12:29:28 -0500 Subject: Remove workaround for pytest-sugar 159, now fixed. --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 78cc7f9..41e20a3 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,6 @@ minversion = 2.4 [testenv] deps = setuptools>=31.0.1 - pytest-sugar-bugfix159 commands = pytest {posargs} python setup.py checkdocs -- cgit v1.2.1 From 6de738440c6333e0f5e7b2447d2b5c05785481db Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 12 Nov 2018 12:31:25 -0500 Subject: Remove pytest-sugar plugin from standard pipelines as recommended in Frozenball/pytest-sugar#159. --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index adaed86..2ea2224 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,6 @@ setup_requires = setuptools_scm >= 1.15.0 testing = # upstream pytest >= 3.5, !=3.7.3 - pytest-sugar >= 0.9.1 collective.checkdocs pytest-flake8 -- cgit v1.2.1 From 95af04d3fcf70a487f59c854d802d9bac193de53 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 28 Nov 2018 12:44:40 -0500 Subject: Prefer pytest-checkdocs to collective.checkdocs --- setup.cfg | 2 +- tox.ini | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 2ea2224..30f3c08 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,7 @@ setup_requires = setuptools_scm >= 1.15.0 testing = # upstream pytest >= 3.5, !=3.7.3 - collective.checkdocs + pytest-checkdocs pytest-flake8 # local diff --git a/tox.ini b/tox.ini index 41e20a3..4121a91 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,6 @@ deps = setuptools>=31.0.1 commands = pytest {posargs} - python setup.py checkdocs usedevelop = True extras = testing -- cgit v1.2.1 From 5c200dd4b98b91911ef9b7403373b84d017e42c0 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 1 Dec 2018 10:46:24 -0500 Subject: Suppress deprecation warning in docutils --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest.ini b/pytest.ini index 61dab3d..bbea8b1 100644 --- a/pytest.ini +++ b/pytest.ini @@ -5,3 +5,5 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS filterwarnings= ignore:Possible nested set::pycodestyle:113 ignore:Using or importing the ABCs::flake8:410 + # workaround for https://sourceforge.net/p/docutils/bugs/348/ + ignore:'U' mode is deprecated::docutils.io -- cgit v1.2.1 From 2c91e8ec0d99f9ca354b7f913d61720925bb98bc Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 1 Dec 2018 11:58:52 -0500 Subject: Remove use of setup_requires. Builders now require pip 10 or later to build/install from sdist. Older installers will still install the packages from wheels. Ref tox-dev/tox#809. --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 30f3c08..e0395d7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,7 +24,6 @@ packages = find: include_package_data = true python_requires = >=2.7 install_requires = -setup_requires = setuptools_scm >= 1.15.0 [options.extras_require] testing = -- cgit v1.2.1 From 216c4336ddb5b498e429219ef765fa1ae857febd Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 11 Dec 2018 14:21:46 -0500 Subject: Revert "Remove use of setup_requires. Builders now require pip 10 or later to build/install from sdist. Older installers will still install the packages from wheels. Ref tox-dev/tox#809." This reverts commit 2c91e8ec0d99f9ca354b7f913d61720925bb98bc. --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index e0395d7..30f3c08 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,6 +24,7 @@ packages = find: include_package_data = true python_requires = >=2.7 install_requires = +setup_requires = setuptools_scm >= 1.15.0 [options.extras_require] testing = -- cgit v1.2.1 From 32b254dee01b5ef2b695ae04889af482c6cb28c3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 12 Dec 2018 13:26:23 -0500 Subject: Indicate build backend of setuptools --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 65d7426..efae667 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,3 @@ [build-system] requires = ["setuptools>=34.4", "wheel", "setuptools_scm>=1.15"] +build-backend = 'setuptools.build_meta' -- cgit v1.2.1 From a8bca166266fa2eeab931f6f20eef8e50048dddf Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 12 Dec 2018 17:08:36 -0500 Subject: Add support for cutting releases without DPL and using pep517. --- .travis.yml | 19 +++++++------------ install-pip-master.py | 21 +++++++++++++++++++++ setup.cfg | 3 --- tox.ini | 15 +++++++++++++++ 4 files changed, 43 insertions(+), 15 deletions(-) create mode 100644 install-pip-master.py diff --git a/.travis.yml b/.travis.yml index b54e8e5..1636305 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,18 +13,13 @@ jobs: - stage: deploy if: tag IS present python: *latest_py3 - install: skip - script: skip - deploy: - provider: pypi - on: - tags: true - all_branches: true - user: jaraco - password: - secure: ... # encrypt password with `travis encrypt` - distributions: dists - skip_cleanup: true + before_script: skip + env: + - TWINE_USERNAME=jaraco + # TWINE_PASSWORD + - secure: ... # encrypt `TWINE_PASSWORD="{password}"` with `travis encrypt` + - TOX_TESTENV_PASSENV="TWINE_USERNAME TWINE_PASSWORD" + script: tox -e release cache: pip diff --git a/install-pip-master.py b/install-pip-master.py new file mode 100644 index 0000000..d62d20f --- /dev/null +++ b/install-pip-master.py @@ -0,0 +1,21 @@ +""" +In order to support installation of pep517 from source, +pip from master must be installed. +""" + +import subprocess +import sys + + +def main(): + cmd = [ + sys.executable, + '-m', 'pip', 'install', + 'git+https://github.com/pypa/pip', + ] + subprocess.run(cmd) + cmd[-1:] = sys.argv[1:] + subprocess.run(cmd) + + +__name__ == '__main__' and main() diff --git a/setup.cfg b/setup.cfg index 30f3c08..726b307 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,3 @@ -[aliases] -dists = clean --all sdist bdist_wheel - [bdist_wheel] universal = 1 diff --git a/tox.ini b/tox.ini index 4121a91..853d7de 100644 --- a/tox.ini +++ b/tox.ini @@ -17,3 +17,18 @@ extras = changedir = docs commands = python -m sphinx . {toxinidir}/build/html + +[testenv:release] +skip_install = True +# workaround for pep517 build support +install_command = python install-pip-master.py {opts} {packages} +deps = + # pull from feature branch for feature + git+https://github.com/pypa/pep517@feature/build-command + # workaround for https://github.com/pypa/twine/issues/423 + git+https://github.com/pypa/twine + path.py +commands = + python -c "import path; path.Path('dist').rmtree_p()" + python -m pep517.build . + python -m twine upload dist/* -- cgit v1.2.1 From bc8a6cdf948376e1c846a121a4e8e4a699c66909 Mon Sep 17 00:00:00 2001 From: Sebastian Kriems Date: Fri, 14 Dec 2018 16:19:36 +0100 Subject: spaces, style and formatters (#4) use spaces, fixed indentation, format using autopep8 --- docs/conf.py | 44 +++++++++++++++++++------------------------- setup.py | 4 ++-- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index aeda56c..49a855f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,32 +1,26 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -extensions = [ - 'sphinx.ext.autodoc', - 'jaraco.packaging.sphinx', - 'rst.linker', -] +extensions = ["sphinx.ext.autodoc", "jaraco.packaging.sphinx", "rst.linker"] -master_doc = 'index' +master_doc = "index" link_files = { - '../CHANGES.rst': dict( - using=dict( - GH='https://github.com', - ), - replace=[ - dict( - pattern=r'(Issue #|\B#)(?P\d+)', - url='{package_url}/issues/{issue}', - ), - dict( - pattern=r'^(?m)((?Pv?\d+(\.\d+){1,2}))\n[-=]+\n', - with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n', - ), - dict( - pattern=r'PEP[- ](?P\d+)', - url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/', - ), - ], - ), + "../CHANGES.rst": dict( + using=dict(GH="https://github.com"), + replace=[ + dict( + pattern=r"(Issue #|\B#)(?P\d+)", + url="{package_url}/issues/{issue}", + ), + dict( + pattern=r"^(?m)((?Pv?\d+(\.\d+){1,2}))\n[-=]+\n", + with_scm="{text}\n{rev[timestamp]:%d %b %Y}\n", + ), + dict( + pattern=r"PEP[- ](?P\d+)", + url="https://www.python.org/dev/peps/pep-{pep_number:0>4}/", + ), + ], + ) } diff --git a/setup.py b/setup.py index c990c52..50e9f0c 100644 --- a/setup.py +++ b/setup.py @@ -4,5 +4,5 @@ import setuptools -if __name__ == '__main__': - setuptools.setup(use_scm_version=True) +if __name__ == "__main__": + setuptools.setup(use_scm_version=True) -- cgit v1.2.1 From 939c515f2cc01525cbbd71f26e71d21471abdc93 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 17 Dec 2018 12:17:02 -0500 Subject: Rely on pep517 0.5 --- install-pip-master.py | 21 --------------------- tox.ini | 5 +---- 2 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 install-pip-master.py diff --git a/install-pip-master.py b/install-pip-master.py deleted file mode 100644 index d62d20f..0000000 --- a/install-pip-master.py +++ /dev/null @@ -1,21 +0,0 @@ -""" -In order to support installation of pep517 from source, -pip from master must be installed. -""" - -import subprocess -import sys - - -def main(): - cmd = [ - sys.executable, - '-m', 'pip', 'install', - 'git+https://github.com/pypa/pip', - ] - subprocess.run(cmd) - cmd[-1:] = sys.argv[1:] - subprocess.run(cmd) - - -__name__ == '__main__' and main() diff --git a/tox.ini b/tox.ini index 853d7de..70b0be7 100644 --- a/tox.ini +++ b/tox.ini @@ -20,11 +20,8 @@ commands = [testenv:release] skip_install = True -# workaround for pep517 build support -install_command = python install-pip-master.py {opts} {packages} deps = - # pull from feature branch for feature - git+https://github.com/pypa/pep517@feature/build-command + pep517>=0.5 # workaround for https://github.com/pypa/twine/issues/423 git+https://github.com/pypa/twine path.py -- cgit v1.2.1 From 192dafa3e9943e971a004d404be1b8e0d20691f2 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 20 Dec 2018 18:11:27 -0500 Subject: Add documentation on the skeleton. Fixes #5. --- .travis.yml | 2 +- setup.py | 2 - skeleton.md | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+), 3 deletions(-) create mode 100644 skeleton.md diff --git a/.travis.yml b/.travis.yml index 1636305..8fc8932 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ jobs: env: - TWINE_USERNAME=jaraco # TWINE_PASSWORD - - secure: ... # encrypt `TWINE_PASSWORD="{password}"` with `travis encrypt` + - secure: ... - TOX_TESTENV_PASSENV="TWINE_USERNAME TWINE_PASSWORD" script: tox -e release diff --git a/setup.py b/setup.py index 50e9f0c..827e955 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,5 @@ #!/usr/bin/env python -# Project skeleton maintained at https://github.com/jaraco/skeleton - import setuptools if __name__ == "__main__": diff --git a/skeleton.md b/skeleton.md new file mode 100644 index 0000000..bc78f37 --- /dev/null +++ b/skeleton.md @@ -0,0 +1,126 @@ +# Overview + +This project is merged with [skeleton](https://github.com/jaraco/skeleton). What is skeleton? It's the scaffolding of a Python project jaraco [introduced in his blog](https://blog.jaraco.com/a-project-skeleton-for-python-projects/). It seeks to provide a means to re-use techniques and inherit advances when managing projects for distribution. + +## An SCM Managed Approach + +While maintaining dozens of projects in PyPI, jaraco derives best practices for project distribution and publishes them in the [skeleton repo](https://github.com/jaraco/skeleton), a git repo capturing the evolution and culmination of these best practices. + +It's intended to be used by a new or existing project to adopt these practices and honed and proven techniques. Adopters are encouraged to use the project directly and maintain a small deviation from the technique, make their own fork for more substantial changes unique to their environment or preferences, or simply adopt the skeleton once and abandon it thereafter. + +The primary advantage to using an SCM for maintaining these techniques is that those tools help facilitate the merge between the template and its adopting projects. + +# Usage + +## new projects + +To use skeleton for a new project, simply pull the skeleton into a new project: + +``` +$ git init my-new-project +$ cd my-new-project +$ git pull gh://jaraco/skeleton +``` + +Now customize the project to suit your individual project needs. + +## existing projects + +If you have an existing project, you can still incorporate the skeleton by merging it into the codebase. + +``` +$ git merge skeleton --allow-unrelated-histories +``` + +The `--allow-unrelated-histories` is necessary because the history from the skeleton was previously unrelated to the existing codebase. Resolve any merge conflicts and commit to the master, and now the project is based on the shared skeleton. + +## Updating + +Whenever a change is needed or desired for the general technique for packaging, it can be made in the skeleton project and then merged into each of the derived projects as needed, recommended before each release. As a result, features and best practices for packaging are centrally maintained and readily trickle into a whole suite of packages. This technique lowers the amount of tedious work necessary to create or maintain a project, and coupled with other techniques like continuous integration and deployment, lowers the cost of creating and maintaining refined Python projects to just a few, familiar git operations. + +Thereafter, the target project can make whatever customizations it deems relevant to the scaffolding. The project may even at some point decide that the divergence is too great to merit renewed merging with the original skeleton. This approach applies maximal guidance while creating minimal constraints. + +# Features + +The features/techniques employed by the skeleton include: + +- PEP 517/518 based build relying on setuptools as the build tool +- setuptools declarative configuration using setup.cfg +- tox for running tests +- A README.rst as reStructuredText with some popular badges, but with readthedocs and appveyor badges commented out +- A CHANGES.rst file intended for publishing release notes about the project. + +## Packaging Conventions + +A pyproject.toml is included to enable PEP 517 and PEP 518 compatibility and declares the requirements necessary to build the project on setuptools (a minimum version compatible with setup.cfg declarative config). + +The setup.cfg file implements the following features: + +- Assumes universal wheel for release +- Advertises the project's LICENSE file (MIT by default) +- Reads the README.rst file into the long description +- Some common Trove classifiers +- Includes all packages discovered in the repo +- Data files in the package are also included (not just Python files) +- Declares the required Python versions +- Declares install requirements (empty by default) +- Declares setup requirements for legacy environments +- Supplies two 'extras': + - testing: requirements for running tests + - docs: requirements for building docs + - these extras split the declaration into "upstream" (requirements as declared by the skeleton) and "local" (those specific to the local project) +- Placeholder for defining entry points + +Additionally, the setup.py file declares `use_scm_version` which relies on [setuptools_scm](https://pypi.org/project/setuptools_scm) to do two things: + +- derive the project version from SCM tags +- ensure that all files committed to the repo are automatically included in releases + +## Running Tests + +The skeleton assumes the developer has [tox](https://pypi.org/project/tox) installed. The developer is expected to run `tox` to run tests on the current Python version using [pytest](https://pypi.org/project/pytest). + +Other environments (invoked with `tox -e {name}`) supplied include: + + - a `build-docs` environment to build the documentation + - a `release` environment to publish the package to PyPI + +A pytest.ini is included to define common options around running tests. In particular: + +- rely on default test discovery in the current directory +- avoid recursing into common directories not containing tests +- run doctests on modules and invoke flake8 tests +- in doctests, allow unicode literals and regular literals to match, allowing for doctests to run on Python 2 and 3. Also enable ELLIPSES, a default that would be undone by supplying the prior option. +- filters out known warnings caused by libraries/functionality included by the skeleton + +Relies a .flake8 file to correct some default behaviors: + +- allow tabs for indentation (legacy for jaraco projects) +- disable mutually incompatible rules W503 and W504. + +## Continuous Integration + +The project is pre-configured to run tests in [Travis-CI](https://travis-ci.org) (.travis.yml). Any new project must be enabled either through their web site or with the `travis enable` command. In addition to running tests, an additional deploy stage is configured to automatically release tagged commits. The username and password for PyPI must be configured for each project using the `travis` command and only after the travis project is created. As releases are cut with [twine](https://pypi.org/project/twine), the two values are supplied through the `TWINE_USERNAME` and `TWINE_PASSWORD`. To configure the latter as a secret, run the following command: + +``` +echo "TWINE_PASSWORD={password}" | travis encrypt +``` + +Or disable it in the CI definition and configure it through the web UI. + +Features include: +- test against Python 2 and 3 +- run on Ubuntu Xenial +- correct for broken IPv6 + +Also provided is a minimal template for running under Appveyor (Windows). + +## Building Documentation + +Documentation is automatically built by [Read the Docs](https://readthedocs.org) when the project is registered with it, by way of the .readthedocs.yml file. To test the docs build manually, a tox env may be invoked as `tox -e build-docs`. Both techniques rely on the dependencies declared in `setup.cfg/options.extras_require.docs`. + +In addition to building the sphinx docs scaffolded in `docs/`, the docs build a `history.html` file that first injects release dates and hyperlinks into the CHANGES.rst before incorporating it as history in the docs. + +## Cutting releases + +By default, tagged commits are released through the continuous integration deploy stage. -- cgit v1.2.1 From 5b4c2503ce84744c0cdf398316d6b18863905297 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 27 Dec 2018 11:42:55 -0500 Subject: Add workaround for DeprecationWarning in flake8 --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest.ini b/pytest.ini index bbea8b1..9b3c1ec 100644 --- a/pytest.ini +++ b/pytest.ini @@ -7,3 +7,5 @@ filterwarnings= ignore:Using or importing the ABCs::flake8:410 # workaround for https://sourceforge.net/p/docutils/bugs/348/ ignore:'U' mode is deprecated::docutils.io + # workaround for https://gitlab.com/pycqa/flake8/issues/275 + ignore:You passed a bytestring as `filenames`.::flake8 -- cgit v1.2.1 From 8ac0f8736c746a829e6393ca5ba00fa8d042d426 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 28 Dec 2018 21:57:02 -0500 Subject: Use consistent encoding quoting in pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index efae667..6f0a516 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] requires = ["setuptools>=34.4", "wheel", "setuptools_scm>=1.15"] -build-backend = 'setuptools.build_meta' +build-backend = "setuptools.build_meta" -- cgit v1.2.1 From 4310c976400dc2eab8d8597b0dffaa7b787cff71 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 28 Dec 2018 22:00:08 -0500 Subject: Clarify purpose of local/upstream extras --- skeleton.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skeleton.md b/skeleton.md index bc78f37..0e0c0ef 100644 --- a/skeleton.md +++ b/skeleton.md @@ -68,7 +68,7 @@ The setup.cfg file implements the following features: - Supplies two 'extras': - testing: requirements for running tests - docs: requirements for building docs - - these extras split the declaration into "upstream" (requirements as declared by the skeleton) and "local" (those specific to the local project) + - these extras split the declaration into "upstream" (requirements as declared by the skeleton) and "local" (those specific to the local project); these markers help avoid merge conflicts - Placeholder for defining entry points Additionally, the setup.py file declares `use_scm_version` which relies on [setuptools_scm](https://pypi.org/project/setuptools_scm) to do two things: -- cgit v1.2.1 From 12eed1326e1bc26ce256e7b3f8cd8d3a5beab2d5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 6 Feb 2019 09:54:00 -0500 Subject: Suppress E117 as workaround for PyCQA/pycodestyle#836 --- .flake8 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.flake8 b/.flake8 index c85d34a..04d2d97 100644 --- a/.flake8 +++ b/.flake8 @@ -2,6 +2,8 @@ ignore = # Allow tabs for indentation W191 + # Workaround for https://github.com/PyCQA/pycodestyle/issues/836 + E117 # W503 violates spec https://github.com/PyCQA/pycodestyle/issues/513 W503 # W504 has issues https://github.com/OCA/maintainer-quality-tools/issues/545 -- cgit v1.2.1 From 8186f76e906f80d678e895f6627afefee5617888 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 6 Feb 2019 09:58:28 -0500 Subject: Amend skeleton documentation to expand on the value of the approach. --- skeleton.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skeleton.md b/skeleton.md index 0e0c0ef..09485cc 100644 --- a/skeleton.md +++ b/skeleton.md @@ -10,6 +10,8 @@ It's intended to be used by a new or existing project to adopt these practices a The primary advantage to using an SCM for maintaining these techniques is that those tools help facilitate the merge between the template and its adopting projects. +Another advantage to using an SCM-managed approach is that tools like GitHub recognize that a change in the skeleton is the _same change_ across all projects that merge with that skeleton. Without the ancestry, with a traditional copy/paste approach, a [commit like this](https://github.com/jaraco/skeleton/commit/12eed1326e1bc26ce256e7b3f8cd8d3a5beab2d5) would produce notifications in the upstream project issue for each and every application, but because it's centralized, GitHub provides just the one notification when the change is added to the skeleton. + # Usage ## new projects -- cgit v1.2.1