From 4b0e3ffd9f0a5c93eb918bbac890f4190bcc9044 Mon Sep 17 00:00:00 2001 From: Antonio Botelho Date: Sun, 28 Jun 2020 19:58:06 +0100 Subject: [PATCH 1/8] Add support for PEP 517/518 --- src/tox_wheel/plugin.py | 72 +++++++++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 10 deletions(-) diff --git a/src/tox_wheel/plugin.py b/src/tox_wheel/plugin.py index a3db990..ae720f9 100644 --- a/src/tox_wheel/plugin.py +++ b/src/tox_wheel/plugin.py @@ -16,7 +16,7 @@ def tox_addoption(parser): parser.add_argument( "--wheel", action="store_true", - help="Use bdist_wheel instead of sdist", + help="Build wheel instead of sdist", ) parser.add_argument( "--wheel-dirty", @@ -27,7 +27,13 @@ def tox_addoption(parser): name="wheel", type="bool", default=False, - help="Use bdist_wheel instead of sdist", + help="Build wheel instead of sdist", + ) + parser.add_testenv_attribute( + name="wheel_pep_517", + type="bool", + default=False, + help="Build wheel using PEP 517/518" ) parser.add_testenv_attribute( name="wheel_dirty", @@ -68,21 +74,29 @@ def tox_package(session, venv): def wheel_build_package(config, session, venv): if config.isolated_build: reporter.warning("Disabling isolated_build, not supported with wheels.") - return wheel_build(config, session, venv) + pep517 = venv.envconfig.wheel_pep_517 + if pep517: + wheel_package = wheel_build_pep517(config, session, venv) + else: + wheel_package = wheel_build_legacy(config, session, venv) + return wheel_package + +def wheel_is_allowed_external(path, venv, is_allowed_external=None): + if is_allowed_external is None: + is_allowed_external = venv.is_allowed_external + if not is_allowed_external(path): + raise RuntimeError("Couldn't find interpreter inside {} for building".format(venv)) + return True -def wheel_build(config, session, venv): + +def wheel_build_legacy(config, session, venv): setup = config.setupdir.join("setup.py") if not setup.check(): reporter.error("No setup.py file found. The expected location is: {}".format(setup)) raise SystemExit(1) with session.newaction(venv.name, "packaging") as action: - def wheel_is_allowed_external(path, is_allowed_external=venv.is_allowed_external): - if not is_allowed_external(path): - raise RuntimeError("Couldn't find interpreter inside {} for building".format(venv)) - return True - - with patch(venv, 'is_allowed_external', wheel_is_allowed_external): + with patch(venv, 'is_allowed_external', partial(wheel_is_allowed_external, venv=venv)): venv.update(action=action) if not (session.config.option.wheel_dirty or venv.envconfig.wheel_dirty): action.setactivity("wheel-make", "cleaning up build directory ...") @@ -122,3 +136,41 @@ def wheel_is_allowed_external(path, is_allowed_external=venv.is_allowed_external ) raise SystemExit(1) return dists[0] + + +def wheel_build_pep517(config, session, venv): + pyproject = config.setupdir.join("pyproject.toml") + if not pyproject.check(): + reporter.error("No pyproject.toml file found. The expected location is: {}".format(pyproject)) + raise SystemExit(1) + with session.newaction(venv.name, "packaging") as action: + with patch(venv, 'is_allowed_external', partial(wheel_is_allowed_external, venv=venv)): + venv.update(action=action) + if not (session.config.option.wheel_dirty or venv.envconfig.wheel_dirty): + action.setactivity("wheel-make", "cleaning up build directory ...") + ensure_empty_dir(config.setupdir.join("build")) + ensure_empty_dir(config.distdir) + venv.test( + name="wheel-make", + commands=[["pip", "wheel", ".", "--no-deps", "-use-pep517", "--wheel-dir", config.distdir]], + redirect=False, + ignore_outcome=False, + ignore_errors=False, + display_hash_seed=False, + ) + try: + dists = config.distdir.listdir() + except py.error.ENOENT: + reporter.error( + "No dist directory found. Please check pyproject.toml, e.g with:\n" + " pip wheel . --use-pep517" + ) + raise SystemExit(1) + else: + if not dists: + reporter.error( + "No distributions found in the dist directory found. Please check pyproject.toml, e.g with:\n" + " pip wheel . --use-pep517" + ) + raise SystemExit(1) + return dists[0] From e5f58f669fe7987c63cba188adabeeed66dd7c99 Mon Sep 17 00:00:00 2001 From: Antonio Botelho Date: Sun, 28 Jun 2020 21:04:18 +0100 Subject: [PATCH 2/8] Add tests for PEP 517/518 support --- src/tox_wheel/plugin.py | 2 +- tests/test_tox_wheel.py | 99 +++++++++++++++++++++++++++++++---------- 2 files changed, 77 insertions(+), 24 deletions(-) diff --git a/src/tox_wheel/plugin.py b/src/tox_wheel/plugin.py index ae720f9..6d72b2b 100644 --- a/src/tox_wheel/plugin.py +++ b/src/tox_wheel/plugin.py @@ -152,7 +152,7 @@ def wheel_build_pep517(config, session, venv): ensure_empty_dir(config.distdir) venv.test( name="wheel-make", - commands=[["pip", "wheel", ".", "--no-deps", "-use-pep517", "--wheel-dir", config.distdir]], + commands=[["pip", "wheel", config.setupdir, "--no-deps", "--use-pep517", "--wheel-dir", config.distdir]], redirect=False, ignore_outcome=False, ignore_errors=False, diff --git a/tests/test_tox_wheel.py b/tests/test_tox_wheel.py index 530fa85..2310602 100644 --- a/tests/test_tox_wheel.py +++ b/tests/test_tox_wheel.py @@ -4,10 +4,10 @@ @pytest.fixture -def testdir(testdir): +def testdir_legacy(testdir): testdir.tmpdir.join('tox.ini').write(""" [tox] -envlist = py27-{a,b} +envlist = py-{a,b} """) testdir.tmpdir.join('setup.py').write(""" from setuptools import setup @@ -18,20 +18,46 @@ def testdir(testdir): return testdir +@pytest.fixture +def testdir_pep517(testdir): + testdir.tmpdir.join('tox.ini').write(""" +[tox] +envlist = py-{a,b} + +[testenv] +wheel = true +wheel_pep_517 = true +""") + testdir.tmpdir.join('setup.py').write(""" +from setuptools import setup + +setup(name='foobar') +""") + testdir.tmpdir.join('pyproject.toml').write(""" +[build-system] +requires = [ + "setuptools >= 35.0.2" +] +build-backend = "setuptools.build_meta" +""") + testdir.tmpdir.join('build').ensure(dir=1) + return testdir + + @pytest.fixture(params=['', '--parallel 1 --parallel-live'], ids=['sequential', 'parallel']) def options(request): - return ['-e', 'py27-a,py27-b'] + request.param.split() + return ['-e', 'py-a,py-b'] + request.param.split() -def test_disabled(testdir, options): - result = testdir.run('tox', *options) +def test_disabled(testdir_legacy, options): + result = testdir_legacy.run('tox', *options) result.stdout.fnmatch_lines([ 'GLOB sdist-make: *', ]) -def test_enabled(testdir, options): - result = testdir.run('tox', '--wheel', *options) +def test_enabled_legacy(testdir_legacy, options): + result = testdir_legacy.run('tox', '--wheel', *options) result.stdout.fnmatch_lines([ 'py* wheel-make: *', ]) @@ -39,19 +65,28 @@ def test_enabled(testdir, options): assert result.ret == 0 -def test_build_env(testdir, options): - testdir.tmpdir.join('setup.cfg').write(""" +def test_enabled_pep517(testdir_pep517, options): + result = testdir_pep517.run('tox', *options) + result.stdout.fnmatch_lines([ + 'py* wheel-make: *', + ]) + assert result.stdout.str().count('Building wheel for foobar (PEP 517)') == 4 + assert result.ret == 0 + + +def test_build_env_legacy(testdir_legacy, options): + testdir_legacy.tmpdir.join('setup.cfg').write(""" [bdist_wheel] universal = 1 """) - testdir.tmpdir.join('tox.ini').write(""" + testdir_legacy.tmpdir.join('tox.ini').write(""" [testenv] wheel = true wheel_build_env = build [testenv:build] """, mode='a') - result = testdir.run('tox', *options) + result = testdir_legacy.run('tox', *options) result.stdout.fnmatch_lines([ 'build wheel-make: *', ]) @@ -59,9 +94,27 @@ def test_build_env(testdir, options): assert result.ret == 0 +def test_build_env_pep517(testdir_pep517, options): + testdir_pep517.tmpdir.join('setup.cfg').write(""" +[bdist_wheel] +universal = 1 +""") + testdir_pep517.tmpdir.join('tox.ini').write(""" +wheel_build_env = build + +[testenv:build] +""", mode='a') + result = testdir_pep517.run('tox', *options) + result.stdout.fnmatch_lines([ + 'build wheel-make: *', + ]) + assert result.stdout.str().count('Building wheel for foobar (PEP 517)') == 2 + assert result.ret == 0 + + @pytest.mark.parametrize('wheel_build_env', ['', 'wheel_build_env']) -def test_skip_usedevelop(testdir, options, wheel_build_env): - testdir.tmpdir.join('tox.ini').write(""" +def test_skip_usedevelop(testdir_legacy, options, wheel_build_env): + testdir_legacy.tmpdir.join('tox.ini').write(""" [testenv] usedevelop = true """ + (""" @@ -69,20 +122,20 @@ def test_skip_usedevelop(testdir, options, wheel_build_env): [testenv:build] """ if wheel_build_env else ""), mode='a') - result = testdir.run('tox', '-v', '--wheel', *options) + result = testdir_legacy.run('tox', '-v', '--wheel', *options) stdout = result.stdout.str() assert stdout.count('wheel-make') == 0 assert stdout.count('bdist_wheel') == 0 assert result.ret == 0 -def test_enabled_toxini_noclean(testdir, options): - testdir.tmpdir.join('tox.ini').write(""" +def test_enabled_toxini_noclean(testdir_legacy, options): + testdir_legacy.tmpdir.join('tox.ini').write(""" [testenv] wheel = true wheel_dirty = true """, mode='a') - result = testdir.run('tox', *options) + result = testdir_legacy.run('tox', *options) result.stdout.fnmatch_lines([ 'py* wheel-make: *', ]) @@ -91,12 +144,12 @@ def test_enabled_toxini_noclean(testdir, options): assert result.ret == 0 -def test_enabled_cli_noclean(testdir, options): - testdir.tmpdir.join('tox.ini').write(""" +def test_enabled_cli_noclean(testdir_legacy, options): + testdir_legacy.tmpdir.join('tox.ini').write(""" [testenv] wheel = true """, mode='a') - result = testdir.run('tox', '--wheel-dirty', *options) + result = testdir_legacy.run('tox', '--wheel-dirty', *options) result.stdout.fnmatch_lines([ 'py* wheel-make: *', ]) @@ -105,12 +158,12 @@ def test_enabled_cli_noclean(testdir, options): assert result.ret == 0 -def test_enabled_toxini(testdir, options): - testdir.tmpdir.join('tox.ini').write(""" +def test_enabled_toxini(testdir_legacy, options): + testdir_legacy.tmpdir.join('tox.ini').write(""" [testenv] wheel = true """, mode='a') - result = testdir.run('tox', '-vv', *options) + result = testdir_legacy.run('tox', '-vv', *options) result.stdout.fnmatch_lines([ 'py* wheel-make: *', 'py* wheel-make: cleaning up build directory ...', From a9c7519d312716b912be81f2ce2d27ec7f541b04 Mon Sep 17 00:00:00 2001 From: Antonio Botelho Date: Mon, 29 Jun 2020 16:12:54 +0100 Subject: [PATCH 3/8] Add test for patch function --- src/tox_wheel/plugin.py | 2 +- tests/test_tox_wheel.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/tox_wheel/plugin.py b/src/tox_wheel/plugin.py index 6d72b2b..76b31cd 100644 --- a/src/tox_wheel/plugin.py +++ b/src/tox_wheel/plugin.py @@ -56,7 +56,7 @@ def patch(obj, attr, value): try: yield finally: - getattr(obj, attr, original) + setattr(obj, attr, original) @hookimpl diff --git a/tests/test_tox_wheel.py b/tests/test_tox_wheel.py index 2310602..0837f8d 100644 --- a/tests/test_tox_wheel.py +++ b/tests/test_tox_wheel.py @@ -1,3 +1,5 @@ +import tox_wheel.plugin + import pytest pytest_plugins = 'pytester', @@ -49,6 +51,17 @@ def options(request): return ['-e', 'py-a,py-b'] + request.param.split() +def test_patch(): + class A(object): + def __init__(self, a): + self.a = a + + obj = A(10) + with tox_wheel.plugin.patch(obj, 'a', 5): + assert obj.a == 5 + assert obj.a == 10 + + def test_disabled(testdir_legacy, options): result = testdir_legacy.run('tox', *options) result.stdout.fnmatch_lines([ From 7a98e2aa0d39d7cf756302df91855d79d78be471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Fri, 17 Jul 2020 16:40:34 +0300 Subject: [PATCH 4/8] Sort import. --- tests/test_tox_wheel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_tox_wheel.py b/tests/test_tox_wheel.py index 0837f8d..20cfb3b 100644 --- a/tests/test_tox_wheel.py +++ b/tests/test_tox_wheel.py @@ -1,7 +1,7 @@ -import tox_wheel.plugin - import pytest +import tox_wheel.plugin + pytest_plugins = 'pytester', From d0712dddbaccd51d743837cba29ad7a891755a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Fri, 17 Jul 2020 17:02:01 +0300 Subject: [PATCH 5/8] Update project skel. --- appveyor.yml => .appveyor.yml | 50 ++++----- .cookiecutterrc | 106 +++++++++--------- .editorconfig | 5 +- .gitignore | 3 + .pre-commit-config.yaml | 19 ++++ .travis.yml | 73 +++++------- CONTRIBUTING.rst | 2 +- MANIFEST.in | 4 +- ci/appveyor-bootstrap.py | 111 ------------------- ci/bootstrap.py | 59 +++++++--- ci/requirements.txt | 4 + ci/templates/{appveyor.yml => .appveyor.yml} | 32 +++--- ci/templates/.travis.yml | 45 +++----- setup.cfg | 14 ++- setup.py | 11 +- tox.ini | 30 ++--- 16 files changed, 242 insertions(+), 326 deletions(-) rename appveyor.yml => .appveyor.yml (71%) create mode 100644 .pre-commit-config.yaml delete mode 100644 ci/appveyor-bootstrap.py create mode 100644 ci/requirements.txt rename ci/templates/{appveyor.yml => .appveyor.yml} (69%) mode change 100644 => 100755 setup.py diff --git a/appveyor.yml b/.appveyor.yml similarity index 71% rename from appveyor.yml rename to .appveyor.yml index 1d6cb00..e6a32e0 100644 --- a/appveyor.yml +++ b/.appveyor.yml @@ -1,85 +1,77 @@ version: '{branch}-{build}' build: off -cache: - - '%LOCALAPPDATA%\pip\Cache' environment: - global: - WITH_COMPILER: 'cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd' matrix: - TOXENV: check TOXPYTHON: C:\Python36\python.exe PYTHON_HOME: C:\Python36 PYTHON_VERSION: '3.6' PYTHON_ARCH: '32' - - TOXENV: 'py27,report' + - TOXENV: py27 TOXPYTHON: C:\Python27\python.exe PYTHON_HOME: C:\Python27 PYTHON_VERSION: '2.7' PYTHON_ARCH: '32' - - TOXENV: 'py27,report' + - TOXENV: py27 TOXPYTHON: C:\Python27-x64\python.exe - WINDOWS_SDK_VERSION: v7.0 PYTHON_HOME: C:\Python27-x64 PYTHON_VERSION: '2.7' PYTHON_ARCH: '64' - - TOXENV: 'py34,report' - TOXPYTHON: C:\Python34\python.exe - PYTHON_HOME: C:\Python34 - PYTHON_VERSION: '3.4' - PYTHON_ARCH: '32' - - TOXENV: 'py34,report' - TOXPYTHON: C:\Python34-x64\python.exe - WINDOWS_SDK_VERSION: v7.1 - PYTHON_HOME: C:\Python34-x64 - PYTHON_VERSION: '3.4' - PYTHON_ARCH: '64' - - TOXENV: 'py35,report' + WINDOWS_SDK_VERSION: v7.0 + - TOXENV: py35 TOXPYTHON: C:\Python35\python.exe PYTHON_HOME: C:\Python35 PYTHON_VERSION: '3.5' PYTHON_ARCH: '32' - - TOXENV: 'py35,report' + - TOXENV: py35 TOXPYTHON: C:\Python35-x64\python.exe PYTHON_HOME: C:\Python35-x64 PYTHON_VERSION: '3.5' PYTHON_ARCH: '64' - - TOXENV: 'py36,report' + - TOXENV: py36 TOXPYTHON: C:\Python36\python.exe PYTHON_HOME: C:\Python36 PYTHON_VERSION: '3.6' PYTHON_ARCH: '32' - - TOXENV: 'py36,report' + - TOXENV: py36 TOXPYTHON: C:\Python36-x64\python.exe PYTHON_HOME: C:\Python36-x64 PYTHON_VERSION: '3.6' PYTHON_ARCH: '64' - - TOXENV: 'py37,report' + - TOXENV: py37 TOXPYTHON: C:\Python37\python.exe PYTHON_HOME: C:\Python37 PYTHON_VERSION: '3.7' PYTHON_ARCH: '32' - - TOXENV: 'py37,report' + - TOXENV: py37 TOXPYTHON: C:\Python37-x64\python.exe PYTHON_HOME: C:\Python37-x64 PYTHON_VERSION: '3.7' PYTHON_ARCH: '64' + - TOXENV: py38 + TOXPYTHON: C:\Python38\python.exe + PYTHON_HOME: C:\Python38 + PYTHON_VERSION: '3.8' + PYTHON_ARCH: '32' + - TOXENV: py38 + TOXPYTHON: C:\Python38-x64\python.exe + PYTHON_HOME: C:\Python38-x64 + PYTHON_VERSION: '3.8' + PYTHON_ARCH: '64' init: - ps: echo $env:TOXENV - ps: ls C:\Python* install: - - python -u ci\appveyor-bootstrap.py + - '%PYTHON_HOME%\python -mpip install --progress-bar=off tox -rci/requirements.txt' - '%PYTHON_HOME%\Scripts\virtualenv --version' - '%PYTHON_HOME%\Scripts\easy_install --version' - '%PYTHON_HOME%\Scripts\pip --version' - '%PYTHON_HOME%\Scripts\tox --version' test_script: - - '%WITH_COMPILER% %PYTHON_HOME%\Scripts\tox' - + - cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd %PYTHON_HOME%\Scripts\tox on_failure: - ps: dir "env:" - ps: get-content .tox\*\log\* -artifacts: - - path: dist\* ### To enable remote debugging uncomment this (also, see: http://www.appveyor.com/docs/how-to/rdp-to-build-worker): # on_finish: diff --git a/.cookiecutterrc b/.cookiecutterrc index 82fb305..ec205be 100644 --- a/.cookiecutterrc +++ b/.cookiecutterrc @@ -1,54 +1,56 @@ -# This file exists so you can easily regenerate your project. -# -# `cookiepatcher` is a convenient shim around `cookiecutter` -# for regenerating projects (it will generate a .cookiecutterrc -# automatically for any template). To use it: -# -# pip install cookiepatcher -# cookiepatcher gh:ionelmc/cookiecutter-pylibrary project-path -# -# See: -# https://pypi.org/project/cookiepatcher -# -# Alternatively, you can run: -# -# cookiecutter --overwrite-if-exists --config-file=project-path/.cookiecutterrc gh:ionelmc/cookiecutter-pylibrary +# Generated by cookiepatcher, a small shim around cookiecutter (pip install cookiepatcher) -default_context: - - _template: 'cookiecutter-pylibrary' - appveyor: 'yes' - c_extension_function: '-' - c_extension_module: '-' - c_extension_optional: 'no' - c_extension_support: 'no' - codacy: 'no' - codeclimate: 'no' - codecov: 'no' - command_line_interface: 'no' +cookiecutter: + _extensions: + - jinja2_time.TimeExtension + _template: /home/ionel/open-source/cookiecutter-pylibrary + allow_tests_inside_package: no + appveyor: yes + c_extension_function: '-' + c_extension_module: '-' + c_extension_optional: no + c_extension_support: no + c_extension_test_pypi: no + c_extension_test_pypi_username: ionelmc + codacy: no + codacy_projectid: '-' + codeclimate: no + codecov: no + command_line_interface: no command_line_interface_bin_name: '-' - coveralls: 'no' - distribution_name: 'tox-wheel' - email: 'contact@ionelmc.ro' - full_name: 'Ionel Cristian Mărieș' - github_username: 'ionelmc' - landscape: 'no' - license: 'BSD 2-Clause License' - linter: 'flake8' - package_name: 'tox_wheel' - project_name: 'tox-wheel' - project_short_description: 'A Tox plugin that builds and installs wheels instead of sdist.' - release_date: 'today' - repo_name: 'tox-wheel' - requiresio: 'yes' - scrutinizer: 'no' - sphinx_docs: 'no' - sphinx_doctest: 'no' - sphinx_theme: 'sphinx-rtd-theme' - test_matrix_configurator: 'no' - test_matrix_separate_coverage: 'no' - test_runner: 'pytest' - travis: 'yes' - version: '0.1.0' - website: 'https://blog.ionelmc.ro' - year: 'now' + coveralls: no + coveralls_token: '-' + distribution_name: tox-wheel + email: contact@ionelmc.ro + full_name: Ionel Cristian Mărieș + landscape: no + license: BSD 2-Clause License + linter: flake8 + package_name: tox_wheel + pre_commit: yes + project_name: tox-wheel + project_short_description: A Tox plugin that builds and installs wheels instead of sdist. + pypi_badge: yes + pypi_disable_upload: no + release_date: '2019-05-15' + repo_hosting: github.com + repo_hosting_domain: github.com + repo_name: tox-wheel + repo_username: ionelmc + requiresio: yes + scrutinizer: no + setup_py_uses_setuptools_scm: no + setup_py_uses_test_runner: no + sphinx_docs: no + sphinx_docs_hosting: '-' + sphinx_doctest: no + sphinx_theme: sphinx-rtd-theme + test_matrix_configurator: no + test_matrix_separate_coverage: no + test_runner: pytest + travis: yes + travis_osx: no + version: 0.4.2 + website: https://blog.ionelmc.ro + year_from: '2019' + year_to: '2020' diff --git a/.editorconfig b/.editorconfig index 4000618..a9c7977 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# see http://editorconfig.org +# see https://editorconfig.org/ root = true [*] @@ -11,3 +11,6 @@ charset = utf-8 [*.{bat,cmd,ps1}] end_of_line = crlf + +[*.{yml,yaml}] +indent_size = 2 diff --git a/.gitignore b/.gitignore index abaa6db..dfe5838 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.py[cod] +__pycache__ # C extensions *.so @@ -21,6 +22,7 @@ lib lib64 venv*/ pyvenv*/ +pip-wheel-metadata/ # Installer logs pip-log.txt @@ -60,6 +62,7 @@ docs/_build .env .cache .pytest +.benchmarks .bootstrap .appveyor.token *.bak diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..e0946b3 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,19 @@ +# To install the git pre-commit hook run: +# pre-commit install +# To update the pre-commit hooks run: +# pre-commit install-hooks +exclude: '^(.tox|ci/templates|.bumpversion.cfg)(/|$)' +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: master + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - repo: https://github.com/timothycrosley/isort + rev: master + hooks: + - id: isort + - repo: https://gitlab.com/pycqa/flake8 + rev: master + hooks: + - id: flake8 diff --git a/.travis.yml b/.travis.yml index ec6442a..20046fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,67 +1,48 @@ language: python -cache: pip +dist: xenial +cache: false env: global: - LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so - SEGFAULT_SIGNALS=all + - LANG=en_US.UTF-8 matrix: include: - python: '3.6' env: - TOXENV=check - - python: '2.7' - env: - - TOXENV=py27,report - - python: '3.4' - env: - - TOXENV=py34,report - - python: '3.5' - env: - - TOXENV=py35,report - - python: '3.6' - env: - - TOXENV=py36,report - - python: '3.7' - dist: xenial - env: - - TOXENV=py37,report - - python: 'pypy' - env: - - TOXENV=pypy,report - - python: 'pypy3' - env: - - TOXENV=pypy3,report + - env: + - TOXENV=py27 + python: '2.7' + - env: + - TOXENV=py35 + python: '3.5' + - env: + - TOXENV=py36 + python: '3.6' + - env: + - TOXENV=py37 + python: '3.7' + - env: + - TOXENV=py38 + python: '3.8' + - env: + - TOXENV=pypy + python: 'pypy' + - env: + - TOXENV=pypy3 + - TOXPYTHON=pypy3 + python: 'pypy3' before_install: - python --version - uname -a - - lsb_release -a + - lsb_release -a || true install: - - pip install tox + - python -mpip install --progress-bar=off tox -rci/requirements.txt - virtualenv --version - easy_install --version - pip --version - tox --version - - | - set -ex - if [[ $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then - (cd $HOME - wget https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-linux64.tar.bz2 - tar xf pypy2-*.tar.bz2 - pypy2-*/bin/pypy -m ensurepip - pypy2-*/bin/pypy -m pip install -U virtualenv) - export PATH=$(echo $HOME/pypy2-*/bin):$PATH - export TOXPYTHON=$(echo $HOME/pypy2-*/bin/pypy) - fi - if [[ $TRAVIS_PYTHON_VERSION == 'pypy3' ]]; then - (cd $HOME - wget https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-linux64.tar.bz2 - tar xf pypy3-*.tar.bz2 - pypy3-*/bin/pypy3 -m ensurepip - pypy3-*/bin/pypy3 -m pip install -U virtualenv) - export PATH=$(echo $HOME/pypy3-*/bin):$PATH - export TOXPYTHON=$(echo $HOME/pypy3-*/bin/pypy3) - fi - set +x script: - tox -v after_failure: diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 1e22cbe..88495d8 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -49,7 +49,7 @@ To set up `tox-wheel` for local development: Now you can make your changes locally. -4. When you're done making changes, run all the checks, doc builder and spell checker with `tox `_ one command:: +4. When you're done making changes run all the checks and docs builder with `tox `_ one command:: tox diff --git a/MANIFEST.in b/MANIFEST.in index 3ae9b54..4752027 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -14,6 +14,6 @@ include CONTRIBUTING.rst include LICENSE include README.rst -include tox.ini .travis.yml appveyor.yml +include tox.ini .travis.yml .appveyor.yml .pre-commit-config.yaml -global-exclude *.py[cod] __pycache__ *.so *.dylib +global-exclude *.py[cod] __pycache__/* *.so *.dylib diff --git a/ci/appveyor-bootstrap.py b/ci/appveyor-bootstrap.py deleted file mode 100644 index dd76230..0000000 --- a/ci/appveyor-bootstrap.py +++ /dev/null @@ -1,111 +0,0 @@ -""" -AppVeyor will at least have few Pythons around so there's no point of implementing a bootstrapper in PowerShell. - -This is a port of https://github.com/pypa/python-packaging-user-guide/blob/master/source/code/install.ps1 -with various fixes and improvements that just weren't feasible to implement in PowerShell. -""" -from __future__ import print_function -from os import environ -from os.path import exists -from subprocess import check_call - -try: - from urllib.request import urlretrieve -except ImportError: - from urllib import urlretrieve - -BASE_URL = "https://www.python.org/ftp/python/" -GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" -GET_PIP_PATH = "C:\get-pip.py" -URLS = { - ("2.7", "64"): BASE_URL + "2.7.13/python-2.7.13.amd64.msi", - ("2.7", "32"): BASE_URL + "2.7.13/python-2.7.13.msi", - ("3.4", "64"): BASE_URL + "3.4.4/python-3.4.4.amd64.msi", - ("3.4", "32"): BASE_URL + "3.4.4/python-3.4.4.msi", - ("3.5", "64"): BASE_URL + "3.5.4/python-3.5.4-amd64.exe", - ("3.5", "32"): BASE_URL + "3.5.4/python-3.5.4.exe", - ("3.6", "64"): BASE_URL + "3.6.2/python-3.6.2-amd64.exe", - ("3.6", "32"): BASE_URL + "3.6.2/python-3.6.2.exe", -} -INSTALL_CMD = { - # Commands are allowed to fail only if they are not the last command. Eg: uninstall (/x) allowed to fail. - "2.7": [["msiexec.exe", "/L*+!", "install.log", "/qn", "/x", "{path}"], - ["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}", "TARGETDIR={home}"]], - "3.4": [["msiexec.exe", "/L*+!", "install.log", "/qn", "/x", "{path}"], - ["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}", "TARGETDIR={home}"]], - "3.5": [["{path}", "/quiet", "TargetDir={home}"]], - "3.6": [["{path}", "/quiet", "TargetDir={home}"]], -} - - -def download_file(url, path): - print("Downloading: {} (into {})".format(url, path)) - progress = [0, 0] - - def report(count, size, total): - progress[0] = count * size - if progress[0] - progress[1] > 1000000: - progress[1] = progress[0] - print("Downloaded {:,}/{:,} ...".format(progress[1], total)) - - dest, _ = urlretrieve(url, path, reporthook=report) - return dest - - -def install_python(version, arch, home): - print("Installing Python", version, "for", arch, "bit architecture to", home) - if exists(home): - return - - path = download_python(version, arch) - print("Installing", path, "to", home) - success = False - for cmd in INSTALL_CMD[version]: - cmd = [part.format(home=home, path=path) for part in cmd] - print("Running:", " ".join(cmd)) - try: - check_call(cmd) - except Exception as exc: - print("Failed command", cmd, "with:", exc) - if exists("install.log"): - with open("install.log") as fh: - print(fh.read()) - else: - success = True - if success: - print("Installation complete!") - else: - print("Installation failed") - - -def download_python(version, arch): - for _ in range(3): - try: - return download_file(URLS[version, arch], "installer.exe") - except Exception as exc: - print("Failed to download:", exc) - print("Retrying ...") - - -def install_pip(home): - pip_path = home + "/Scripts/pip.exe" - python_path = home + "/python.exe" - if exists(pip_path): - print("pip already installed.") - else: - print("Installing pip...") - download_file(GET_PIP_URL, GET_PIP_PATH) - print("Executing:", python_path, GET_PIP_PATH) - check_call([python_path, GET_PIP_PATH]) - - -def install_packages(home, *packages): - cmd = [home + "/Scripts/pip.exe", "install"] - cmd.extend(packages) - check_call(cmd) - - -if __name__ == "__main__": - install_python(environ['PYTHON_VERSION'], environ['PYTHON_ARCH'], environ['PYTHON_HOME']) - install_pip(environ['PYTHON_HOME']) - install_packages(environ['PYTHON_HOME'], "setuptools>=18.0.1", "wheel", "tox", "virtualenv>=13.1.0") diff --git a/ci/bootstrap.py b/ci/bootstrap.py index e64a6c0..2eb7723 100755 --- a/ci/bootstrap.py +++ b/ci/bootstrap.py @@ -1,18 +1,26 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import +from __future__ import print_function +from __future__ import unicode_literals import os +import subprocess import sys from os.path import abspath from os.path import dirname from os.path import exists from os.path import join +base_path = dirname(dirname(abspath(__file__))) -if __name__ == "__main__": - base_path = dirname(dirname(abspath(__file__))) - print("Project path: {0}".format(base_path)) + +def check_call(args): + print("+", *args) + subprocess.check_call(args) + + +def exec_in_env(): env_path = join(base_path, ".tox", "bootstrap") if sys.platform == "win32": bin_path = join(env_path, "Scripts") @@ -23,19 +31,27 @@ print("Making bootstrap env in: {0} ...".format(env_path)) try: - subprocess.check_call(["virtualenv", env_path]) + check_call([sys.executable, "-m", "venv", env_path]) except subprocess.CalledProcessError: - subprocess.check_call([sys.executable, "-m", "virtualenv", env_path]) + try: + check_call([sys.executable, "-m", "virtualenv", env_path]) + except subprocess.CalledProcessError: + check_call(["virtualenv", env_path]) print("Installing `jinja2` into bootstrap environment...") - subprocess.check_call([join(bin_path, "pip"), "install", "jinja2"]) + check_call([join(bin_path, "pip"), "install", "jinja2", "tox"]) python_executable = join(bin_path, "python") - if not os.path.samefile(python_executable, sys.executable): - print("Re-executing with: {0}".format(python_executable)) - os.execv(python_executable, [python_executable, __file__]) + if not os.path.exists(python_executable): + python_executable += '.exe' + + print("Re-executing with: {0}".format(python_executable)) + print("+ exec", python_executable, __file__, "--no-env") + os.execv(python_executable, [python_executable, __file__, "--no-env"]) + +def main(): import jinja2 - import subprocess + print("Project path: {0}".format(base_path)) jinja = jinja2.Environment( loader=jinja2.FileSystemLoader(join(base_path, "ci", "templates")), @@ -46,13 +62,28 @@ tox_environments = [ line.strip() - # WARNING: 'tox' must be installed globally or in the project's virtualenv - for line in subprocess.check_output(['tox', '--listenvs'], universal_newlines=True).splitlines() + # 'tox' need not be installed globally, but must be importable + # by the Python that is running this script. + # This uses sys.executable the same way that the call in + # cookiecutter-pylibrary/hooks/post_gen_project.py + # invokes this bootstrap.py itself. + for line in subprocess.check_output([sys.executable, '-m', 'tox', '--listenvs'], universal_newlines=True).splitlines() ] - tox_environments = [line for line in tox_environments if line not in ['clean', 'report', 'docs', 'check']] + tox_environments = [line for line in tox_environments if line.startswith('py')] for name in os.listdir(join("ci", "templates")): with open(join(base_path, name), "w") as fh: fh.write(jinja.get_template(name).render(tox_environments=tox_environments)) print("Wrote {}".format(name)) print("DONE.") + + +if __name__ == "__main__": + args = sys.argv[1:] + if args == ["--no-env"]: + main() + elif not args: + exec_in_env() + else: + print("Unexpected arguments {0}".format(args), file=sys.stderr) + sys.exit(1) diff --git a/ci/requirements.txt b/ci/requirements.txt new file mode 100644 index 0000000..b2a21e5 --- /dev/null +++ b/ci/requirements.txt @@ -0,0 +1,4 @@ +virtualenv>=16.6.0 +pip>=19.1.1 +setuptools>=18.0.1 +six>=1.12.0 diff --git a/ci/templates/appveyor.yml b/ci/templates/.appveyor.yml similarity index 69% rename from ci/templates/appveyor.yml rename to ci/templates/.appveyor.yml index 32db8ad..d947489 100644 --- a/ci/templates/appveyor.yml +++ b/ci/templates/.appveyor.yml @@ -1,50 +1,48 @@ version: '{branch}-{build}' build: off -cache: - - '%LOCALAPPDATA%\pip\Cache' environment: - global: - WITH_COMPILER: 'cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd' matrix: - TOXENV: check TOXPYTHON: C:\Python36\python.exe PYTHON_HOME: C:\Python36 PYTHON_VERSION: '3.6' PYTHON_ARCH: '32' -{% for env in tox_environments %}{{ '' }}{% if env.startswith(('py2', 'py3')) %} - - TOXENV: '{{ env }},report' +{% for env in tox_environments %} +{% if env.startswith(('py2', 'py3')) %} + - TOXENV: {{ env }}{{ "" }} TOXPYTHON: C:\Python{{ env[2:4] }}\python.exe PYTHON_HOME: C:\Python{{ env[2:4] }} PYTHON_VERSION: '{{ env[2] }}.{{ env[3] }}' PYTHON_ARCH: '32' - - TOXENV: '{{ env }},report' +{% if 'nocov' in env %} + WHEEL_PATH: .tox/dist +{% endif %} + - TOXENV: {{ env }}{{ "" }} TOXPYTHON: C:\Python{{ env[2:4] }}-x64\python.exe - {%- if env.startswith(('py2', 'py34')) %} - - WINDOWS_SDK_VERSION: v7.{{ '1' if env.startswith('py3') else '0' }} - {%- endif %} - PYTHON_HOME: C:\Python{{ env[2:4] }}-x64 PYTHON_VERSION: '{{ env[2] }}.{{ env[3] }}' PYTHON_ARCH: '64' +{% if 'nocov' in env %} + WHEEL_PATH: .tox/dist +{% endif %} +{% if env.startswith('py2') %} + WINDOWS_SDK_VERSION: v7.0 +{% endif %} {% endif %}{% endfor %} init: - ps: echo $env:TOXENV - ps: ls C:\Python* install: - - python -u ci\appveyor-bootstrap.py + - '%PYTHON_HOME%\python -mpip install --progress-bar=off tox -rci/requirements.txt' - '%PYTHON_HOME%\Scripts\virtualenv --version' - '%PYTHON_HOME%\Scripts\easy_install --version' - '%PYTHON_HOME%\Scripts\pip --version' - '%PYTHON_HOME%\Scripts\tox --version' test_script: - - '%WITH_COMPILER% %PYTHON_HOME%\Scripts\tox' - + - cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd %PYTHON_HOME%\Scripts\tox on_failure: - ps: dir "env:" - ps: get-content .tox\*\log\* -artifacts: - - path: dist\* ### To enable remote debugging uncomment this (also, see: http://www.appveyor.com/docs/how-to/rdp-to-build-worker): # on_finish: diff --git a/ci/templates/.travis.yml b/ci/templates/.travis.yml index 9cd6da2..6a902a4 100644 --- a/ci/templates/.travis.yml +++ b/ci/templates/.travis.yml @@ -1,53 +1,38 @@ language: python -cache: pip +dist: xenial +cache: false env: global: - LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so - SEGFAULT_SIGNALS=all + - LANG=en_US.UTF-8 matrix: include: - python: '3.6' env: - TOXENV=check {%- for env in tox_environments %}{{ '' }} - - python: '{{ env.split("-")[0] if env.startswith("pypy") else "{0[2]}.{0[3]}".format(env) }}' -{% if env.startswith('py37') %} - dist: xenial -{% endif %} - env: - - TOXENV={{ env }},report + - env: + - TOXENV={{ env }} +{%- if env.startswith('pypy3') %}{{ '' }} + - TOXPYTHON=pypy3 + python: 'pypy3' +{%- elif env.startswith('pypy') %}{{ '' }} + python: 'pypy' +{%- else %}{{ '' }} + python: '{{ '{0[2]}.{0[3]}'.format(env) }}' +{%- endif %} {%- endfor %}{{ '' }} before_install: - python --version - uname -a - - lsb_release -a + - lsb_release -a || true install: - - pip install tox + - python -mpip install --progress-bar=off tox -rci/requirements.txt - virtualenv --version - easy_install --version - pip --version - tox --version - - | - set -ex - if [[ $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then - (cd $HOME - wget https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-linux64.tar.bz2 - tar xf pypy2-*.tar.bz2 - pypy2-*/bin/pypy -m ensurepip - pypy2-*/bin/pypy -m pip install -U virtualenv) - export PATH=$(echo $HOME/pypy2-*/bin):$PATH - export TOXPYTHON=$(echo $HOME/pypy2-*/bin/pypy) - fi - if [[ $TRAVIS_PYTHON_VERSION == 'pypy3' ]]; then - (cd $HOME - wget https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-linux64.tar.bz2 - tar xf pypy3-*.tar.bz2 - pypy3-*/bin/pypy3 -m ensurepip - pypy3-*/bin/pypy3 -m pip install -U virtualenv) - export PATH=$(echo $HOME/pypy3-*/bin):$PATH - export TOXPYTHON=$(echo $HOME/pypy3-*/bin/pypy3) - fi - set +x script: - tox -v after_failure: diff --git a/setup.cfg b/setup.cfg index 8aafae0..40a0dc3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,13 +1,15 @@ [bdist_wheel] universal = 1 - [flake8] max-line-length = 140 -exclude = */migrations/* +exclude = .tox,.eggs,ci/templates [tool:pytest] -testpaths = tests +# If a pytest section is found in one of the possible config files +# (pytest.ini, tox.ini or setup.cfg), then pytest will not look for any others, +# so if you add a pytest config section elsewhere, +# you will need to delete this section from setup.cfg. norecursedirs = migrations @@ -21,12 +23,14 @@ addopts = --doctest-modules --doctest-glob=\*.rst --tb=short +testpaths = + tests -[isort] +[tool:isort] force_single_line = True line_length = 120 known_first_party = tox_wheel default_section = THIRDPARTY forced_separate = test_tox_wheel not_skip = __init__.py -skip = migrations \ No newline at end of file +skip = .tox,.eggs,ci/templates diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index aa9698c..5b50bc9 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def read(*names, **kwargs): setup( name='tox-wheel', version='0.4.2', - license='BSD 2-Clause License', + license='BSD-2-Clause', description='A Tox plugin that builds and installs wheels instead of sdist.', long_description='%s\n%s' % ( re.compile('^.. start-badges.*^.. end-badges', re.M | re.S).sub('', read('README.rst')), @@ -51,10 +51,10 @@ def read(*names, **kwargs): 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', # uncomment if you test on these interpreters: @@ -63,13 +63,14 @@ def read(*names, **kwargs): # 'Programming Language :: Python :: Implementation :: Stackless', 'Topic :: Utilities', ], - keywords=[ - # eg: 'keyword1', 'keyword2', 'keyword3', - ], project_urls={ 'Changelog': 'https://github.com/ionelmc/tox-wheel/blob/master/CHANGELOG.rst', 'Issue Tracker': 'https://github.com/ionelmc/tox-wheel/issues', }, + keywords=[ + # eg: 'keyword1', 'keyword2', 'keyword3', + ], + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', install_requires=[ 'tox>=3.9.0', 'wheel>=0.33.1', diff --git a/tox.ini b/tox.ini index 4bcb2bb..9cdca9a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,21 +1,32 @@ +[testenv:bootstrap] +deps = + jinja2 + matrix + tox +skip_install = true +commands = + python ci/bootstrap.py --no-env +passenv = + * ; a generative tox configuration, see: https://tox.readthedocs.io/en/latest/config.html#generative-envlist [tox] envlist = clean, check, - {py27,py34,py35,py36,py37,pypy,pypy3}, + {py27,py35,py36,py37,py38,pypy,pypy3}, report +ignore_basepython_conflict = true [testenv] basepython = pypy: {env:TOXPYTHON:pypy} pypy3: {env:TOXPYTHON:pypy3} py27: {env:TOXPYTHON:python2.7} - py34: {env:TOXPYTHON:python3.4} py35: {env:TOXPYTHON:python3.5} py36: {env:TOXPYTHON:python3.6} py37: {env:TOXPYTHON:python3.7} + py38: {env:TOXPYTHON:python3.8} {bootstrap,clean,check,report}: {env:TOXPYTHON:python3} setenv = PYTHONPATH={toxinidir}/tests @@ -36,14 +47,6 @@ deps = commands = {posargs:pytest --cov --cov-report=term-missing -vv tests} -[testenv:bootstrap] -deps = - jinja2 - matrix -skip_install = true -commands = - python ci/bootstrap.py - [testenv:check] deps = docutils @@ -56,11 +59,12 @@ skip_install = true commands = python setup.py check --strict --metadata --restructuredtext check-manifest {toxinidir} - flake8 src tests setup.py - isort --verbose --check-only --diff --recursive src tests setup.py + flake8 + isort --verbose --check-only --diff --recursive [testenv:report] -deps = coverage +deps = + coverage skip_install = true commands = coverage report From c4f7d9e1abd6f8b9ca1090b96145575b4dd66b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Fri, 17 Jul 2020 17:08:27 +0300 Subject: [PATCH 6/8] Add keywords. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5b50bc9..c37193b 100755 --- a/setup.py +++ b/setup.py @@ -68,7 +68,7 @@ def read(*names, **kwargs): 'Issue Tracker': 'https://github.com/ionelmc/tox-wheel/issues', }, keywords=[ - # eg: 'keyword1', 'keyword2', 'keyword3', + 'tox', 'tox-wheel', 'wheel', 'pep517', 'pep518', ], python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', install_requires=[ From 0aca7cd30168fea9ace472f4b90427c44055b8d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Fri, 17 Jul 2020 17:30:48 +0300 Subject: [PATCH 7/8] Fix badges. --- README.rst | 60 +++++++++++++----------------------------------------- 1 file changed, 14 insertions(+), 46 deletions(-) diff --git a/README.rst b/README.rst index 417c7f3..919a151 100644 --- a/README.rst +++ b/README.rst @@ -7,8 +7,6 @@ Overview .. list-table:: :stub-columns: 1 - * - docs - - |docs| * - tests - | |travis| |appveyor| |requires| | @@ -16,9 +14,7 @@ Overview - | |version| |wheel| |supported-versions| |supported-implementations| | |commits-since| - - -.. |travis| image:: https://travis-ci.org/ionelmc/tox-wheel.svg?branch=master +.. |travis| image:: https://api.travis-ci.org/ionelmc/tox-wheel.svg?branch=master :alt: Travis-CI Build Status :target: https://travis-ci.org/ionelmc/tox-wheel @@ -34,10 +30,6 @@ Overview :alt: PyPI Package latest release :target: https://pypi.org/project/tox-wheel -.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/tox-wheel/v0.4.2.svg - :alt: Commits since latest release - :target: https://github.com/ionelmc/tox-wheel/compare/v0.4.2...master - .. |wheel| image:: https://img.shields.io/pypi/wheel/tox-wheel.svg :alt: PyPI Wheel :target: https://pypi.org/project/tox-wheel @@ -50,6 +42,9 @@ Overview :alt: Supported implementations :target: https://pypi.org/project/tox-wheel +.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/tox-wheel/v0.4.2.svg + :alt: Commits since latest release + :target: https://github.com/ionelmc/tox-wheel/compare/v0.4.2...master .. end-badges @@ -66,9 +61,9 @@ What does this plugin actually do? What it doesn't? * Universal wheels are not detected. * No support for ``pyproject.toml`` yet. -What projects use this? +A Tox plugin that builds and installs wheels instead of sdist. -* `hunter `_ (also publishes the wheels built by this plugin) +* Free software: BSD 2-Clause License Installation ============ @@ -77,49 +72,22 @@ Installation pip install tox-wheel -Documentation -============= - -Two ways to use: - -* Run ``tox --wheel`` -* Have this in your ``tox.ini``: - - .. code-block:: ini - - [testenv] - wheel = true - -Additional settings: +You can also install the in-development version with:: -* You can also disable ``build`` directory removal (dirty builds, use at your own peril): + pip install https://github.com/ionelmc/tox-wheel/archive/master.zip - .. code-block:: ini - [testenv] - wheel_clean_build = false - -* By default the build environment is the same environment that the wheel gets installed to. You can change it, eg: - - .. code-block:: ini - - [tox] - envlist = py27{,-build} +Documentation +============= - [testenv] - wheel_build_env = {envname}-build - deps = - build: cython - Or, if you have universal wheels you can have a single build env: +To use the project: - .. code-block:: ini +.. code-block:: python - [testenv] - wheel_build_env = build + import tox_wheel + tox_wheel.-() - [testenv:build] - deps = setuptools_scm Development =========== From b816ebedca2d71bd8790e0f148512afc37b10427 Mon Sep 17 00:00:00 2001 From: Antonio Botelho Date: Fri, 24 Jul 2020 20:47:44 +0100 Subject: [PATCH 8/8] Add contributor, updated changelog and readme --- AUTHORS.rst | 2 ++ CHANGELOG.rst | 5 +++++ README.rst | 1 - 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index d01607a..484c32b 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -3,3 +3,5 @@ Authors ======= * Ionel Cristian Mărieș - https://blog.ionelmc.ro + +* Antonio Botelho - https://github.com/botant/ diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1c1f446..d65bb00 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog ========= +0.X.Y (2020-07-24) +------------------ + +* Added support for PEP 517/518. + 0.4.2 (2019-05-15) ------------------ diff --git a/README.rst b/README.rst index 919a151..f52a72f 100644 --- a/README.rst +++ b/README.rst @@ -59,7 +59,6 @@ What does this plugin actually do? What it doesn't? However, you can configure it so it builds only once, if your project can build universal wheels. * Universal wheels are not detected. -* No support for ``pyproject.toml`` yet. A Tox plugin that builds and installs wheels instead of sdist.