From 43c58f5dba555a627a60fb2557f50f7b279265f3 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 12 Feb 2017 09:42:40 -0800 Subject: [PATCH 001/225] Attempt to support clang (osx/freebsd) --- setuptools_golang.py | 49 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index 55dbed3..eefc38e 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -2,6 +2,7 @@ from __future__ import unicode_literals import contextlib +import io import os import pipes import shutil @@ -12,10 +13,47 @@ from setuptools.command.build_ext import build_ext as _build_ext +@contextlib.contextmanager +def _tmpdir(): + tempdir = tempfile.mkdtemp() + try: + yield tempdir + finally: + shutil.rmtree(tempdir) + + def _get_cflags(compiler): return ' '.join('-I{}'.format(p) for p in compiler.include_dirs) +LFLAG_CLANG = '-Wl,-undefined,dynamic_lookup' +LFLAG_GCC = '-Wl,--unresolved-symbols=ignore-all' +LFLAGS = (LFLAG_CLANG, LFLAG_GCC) + + +def _get_ldflags(): + """Determine the correct link flags. This attempts dummy compiles similar + to how autotools does feature detection. + """ + cc = subprocess.check_output(('go', 'env', 'CC')).decode('UTF-8').strip() + + with _tmpdir() as tmpdir: + testf = os.path.join(tmpdir, 'test.c') + with io.open(testf, 'w') as f: + f.write('int f(int); int main(void) { return f(0); }\n') + + for lflag in LFLAGS: # pragma: no cover (platform specific) + try: + subprocess.check_call((cc, testf, lflag), cwd=tmpdir) + return lflag + except subprocess.CalledProcessError: + pass + else: # pragma: no cover (platform specific) + # wellp, none of them worked, fall back to gcc and they'll get a + # hopefully reasonable error message + return LFLAG_GCC + + def _check_call(cmd, cwd, env): envparts = [ '{}={}'.format(k, pipes.quote(v)) @@ -28,15 +66,6 @@ def _check_call(cmd, cwd, env): subprocess.check_call(cmd, cwd=cwd, env=dict(os.environ, **env)) -@contextlib.contextmanager -def _tmpdir(): - tempdir = tempfile.mkdtemp() - try: - yield tempdir - finally: - shutil.rmtree(tempdir) - - def _get_build_extension_method(base, root): def build_extension(self, ext): def _raise_error(msg): @@ -73,7 +102,7 @@ def _raise_error(msg): env.update({ 'CGO_CFLAGS': _get_cflags(self.compiler), - 'CGO_LDFLAGS': '-Wl,--unresolved-symbols=ignore-all', + 'CGO_LDFLAGS': _get_ldflags(), }) cmd_build = ( 'go', 'build', '-buildmode=c-shared', From ea4c2413265405583a3ad2f29f506d2dca2786e9 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 13 Feb 2017 18:59:53 -0800 Subject: [PATCH 002/225] v1.1.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 854251e..c849361 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ 'golang.' ), url='https://github.com/asottile/setuptools-golang', - version='1.0.0', + version='1.1.0', author='Anthony Sottile', author_email='asottile@umich.edu', classifiers=[ From ec99895ac1f160804e9611c54b67f075bbb5089a Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 30 Apr 2017 19:50:24 -0700 Subject: [PATCH 003/225] Fix coveralls? --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f2e3337..d7d2bcf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: python -sudo: false matrix: include: - env: TOXENV=py27 GO=1.6 @@ -14,7 +13,7 @@ install: - eval "$(gimme $GO)" - pip install coveralls tox script: tox -after_success: coveralls +after_success: TOP=. coveralls cache: directories: - $HOME/.cache/pip From 1682b7038aa0a7bed71d25bdb7182cb220f234ff Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 14 Aug 2017 18:25:30 -0700 Subject: [PATCH 004/225] Ran pre-commit autoupdate. Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 26efa14..33e7460 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ - repo: https://github.com/pre-commit/pre-commit-hooks.git - sha: v0.7.0 + sha: v0.9.1 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -10,7 +10,7 @@ - id: requirements-txt-fixer - id: flake8 - repo: https://github.com/asottile/reorder_python_imports.git - sha: v0.3.1 + sha: v0.3.5 hooks: - id: reorder-python-imports - repo: local From 5121bf31e2971cdb76d340f3fdad5c90804e156c Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 7 Sep 2017 10:31:04 -0700 Subject: [PATCH 005/225] Ran pre-commit migrate-config. Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 33e7460..a736e65 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,4 @@ +repos: - repo: https://github.com/pre-commit/pre-commit-hooks.git sha: v0.9.1 hooks: From bb142f87653876a2352dc94f0a99d8956a261dbd Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 7 Sep 2017 19:32:16 -0700 Subject: [PATCH 006/225] Update pre-commit cache directory. Committed via https://github.com/asottile/all-repos --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d7d2bcf..62c0e14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,4 +17,4 @@ after_success: TOP=. coveralls cache: directories: - $HOME/.cache/pip - - $HOME/.pre-commit + - $HOME/.cache/pre-commit From 3cd27fd449a7bb04960a3beb664e3b686470e7c5 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 21 Oct 2017 08:59:30 -0700 Subject: [PATCH 007/225] git ls-files -z -- .coveragerc | xargs -0 sed -i '/ \*\/tmp\*/d' Committed via https://github.com/asottile/all-repos --- .coveragerc | 1 - 1 file changed, 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 2a9fb1b..692fdc7 100644 --- a/.coveragerc +++ b/.coveragerc @@ -6,7 +6,6 @@ data_file = $TOP/.coverage omit = .tox/* /usr/* - */tmp* setup.py [report] From 0fbd679ca73926156bbb0d42175c7812ce59c236 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 26 Nov 2017 19:04:23 -0800 Subject: [PATCH 008/225] Move tests --- tests/__init__.py | 0 setuptools_golang_test.py => tests/setuptools_golang_test.py | 2 +- tox.ini | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 tests/__init__.py rename setuptools_golang_test.py => tests/setuptools_golang_test.py (98%) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/setuptools_golang_test.py b/tests/setuptools_golang_test.py similarity index 98% rename from setuptools_golang_test.py rename to tests/setuptools_golang_test.py index 5e8dbe2..afb6d60 100644 --- a/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -13,7 +13,7 @@ @pytest.fixture(autouse=True, scope='session') def enable_coverage_subprocesses(): - here = os.path.dirname(os.path.abspath(__file__)) + here = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.environ['TOP'] = here os.environ['COVERAGE_PROCESS_START'] = os.path.join(here, '.coveragerc') diff --git a/tox.ini b/tox.ini index 1d3428e..1b180d5 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ passenv = HOME GOROOT setenv = TOP={toxinidir} commands = coverage erase - coverage run -m pytest {posargs:setuptools_golang_test.py} + coverage run -m pytest {posargs:tests} coverage combine coverage report --show-missing --fail-under 100 pre-commit install -f --install-hooks From 9fb2fb530db78d117ea51199d2c63c2dea345c44 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 4 Dec 2017 15:45:00 -0800 Subject: [PATCH 009/225] Add a common failure mode discovered with clang to README --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 184c5f5..e344285 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,19 @@ Double check that your import is correct. You've probably mistyped an import. Double check that your import is correct. +### `duplicate symbol _XXX in: _cgo_export.o mod.cgo2.o` + +For example: +``` +# github.com/asottile/dockerfile/pylib +duplicate symbol _PyDockerfile_GoParseError in: + $WORK/github.com/asottile/dockerfile/pylib/_obj/_cgo_export.o + $WORK/github.com/asottile/dockerfile/pylib/_obj/main.cgo2.o +``` + +Make sure to mark global variables defined in C as `extern`. +[Here's an example PR](https://github.com/asottile/dockerfile/pull/8) + ## Building manylinux wheels `setuptools-golang` also provides a tool for building From 8682b03d621e65b081aea7b2d01e17705a0e2385 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 5 Dec 2017 09:36:42 -0800 Subject: [PATCH 010/225] Only remove 'dist' if it exists --- setuptools_golang.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index eefc38e..c0a091f 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -132,7 +132,8 @@ def set_build_ext(dist, attr, value): def build_manylinux_wheels(argv=None): # pragma: no cover assert os.path.exists('setup.py') - shutil.rmtree('dist') + if os.path.exists('dist'): + shutil.rmtree('dist') os.makedirs('dist') _check_call(('python', 'setup.py', 'sdist'), cwd='.', env={}) _check_call( From 27575fb5b6292effe339df73ba23483487fd9950 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 26 Nov 2017 22:14:11 -0800 Subject: [PATCH 011/225] Windows support --- README.md | 7 +++++++ appveyor.yml | 19 +++++++++++++++++++ setuptools_golang.py | 31 +++++++++++++++++++++++++------ tests/setuptools_golang_test.py | 26 ++++++++++++++------------ 4 files changed, 65 insertions(+), 18 deletions(-) create mode 100644 appveyor.yml diff --git a/README.md b/README.md index e344285..c2970f6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![Build Status](https://travis-ci.org/asottile/setuptools-golang.svg?branch=master)](https://travis-ci.org/asottile/setuptools-golang) +[![Build status](https://ci.appveyor.com/api/projects/status/j4i2pc4o7pby3wdn/branch/master?svg=true)](https://ci.appveyor.com/project/asottile/setuptools-golang/branch/master) [![Coverage Status](https://img.shields.io/coveralls/asottile/setuptools-golang.svg?branch=master)](https://coveralls.io/r/asottile/setuptools-golang) setuptools-golang @@ -13,6 +14,12 @@ This requires golang >= 1.5. It is currently tested against 1.6 and 1.7. This requires python >= 2.7. It is currently tested against 2.7, 3.5, 3.6, and pypy. +## Platform Support + +- linux +- macos +- win32 (32 bit cpython, 32 bit go 1.10+) + ## Usage Add `setuptools-golang` to the `setup_requires` in your setup.py and diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..1da6e36 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,19 @@ +environment: + matrix: + - PYTHON: 'C:\Python27' + - PYTHON: 'C:\Python36' + +install: +- 'SET PATH=%PYTHON%;%PYTHON%\Scripts;C:\MinGW\bin;C:\go-src\bin;%PATH%' +- 'SET GOROOT=C:\go-src' +- 'SET GOROOT_BOOTSTRAP=C:\go19-x86' +- 'git clone --branch=go1.10beta1 --depth=1 https://github.com/golang/go C:\go-src' +- 'cd C:\go-src\src && make.bat' +- 'pip install pytest' + +# Not a C# project +build: false + +test_script: pytest tests + +cache: '%LOCALAPPDATA%\pip\cache' diff --git a/setuptools_golang.py b/setuptools_golang.py index c0a091f..dd7b423 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -2,10 +2,12 @@ from __future__ import unicode_literals import contextlib +import copy import io import os import pipes import shutil +import stat import subprocess import sys import tempfile @@ -19,11 +21,16 @@ def _tmpdir(): try: yield tempdir finally: - shutil.rmtree(tempdir) + def err(action, name, exc): # pragma: no cover (windows) + """windows: can't remove readonly files, make them writeable!""" + os.chmod(name, stat.S_IWRITE) + action(name) + + shutil.rmtree(tempdir, onerror=err) def _get_cflags(compiler): - return ' '.join('-I{}'.format(p) for p in compiler.include_dirs) + return str(' ').join(str('-I{}').format(p) for p in compiler.include_dirs) LFLAG_CLANG = '-Wl,-undefined,dynamic_lookup' @@ -35,6 +42,12 @@ def _get_ldflags(): """Determine the correct link flags. This attempts dummy compiles similar to how autotools does feature detection. """ + # windows gcc does not support linking with unresolved symbols + if sys.platform == 'win32': # pragma: no cover (windows) + prefix = getattr(sys, 'real_prefix', sys.prefix) + libs = os.path.join(prefix, str('libs')) + return str('-L{} -lpython{}{}').format(libs, *sys.version_info[:2]) + cc = subprocess.check_output(('go', 'env', 'CC')).decode('UTF-8').strip() with _tmpdir() as tmpdir: @@ -75,7 +88,13 @@ def _raise_error(msg): # If there are no .go files then the parent should handle this if not any(source.endswith('.go') for source in ext.sources): - return base.build_extension(self, ext) + # the base class may mutate `self.compiler` + compiler = copy.deepcopy(self.compiler) + self.compiler, compiler = compiler, self.compiler + try: + return base.build_extension(self, ext) + finally: + self.compiler, compiler = compiler, self.compiler if len(ext.sources) != 1: _raise_error( @@ -96,13 +115,13 @@ def _raise_error(msg): shutil.copytree('.', root_path) pkg_path = os.path.join(root_path, main_dir) - env = {'GOPATH': tempdir} + env = {str('GOPATH'): tempdir} cmd_get = ('go', 'get', '-d') _check_call(cmd_get, cwd=pkg_path, env=env) env.update({ - 'CGO_CFLAGS': _get_cflags(self.compiler), - 'CGO_LDFLAGS': _get_ldflags(), + str('CGO_CFLAGS'): _get_cflags(self.compiler), + str('CGO_LDFLAGS'): _get_ldflags(), }) cmd_build = ( 'go', 'build', '-buildmode=c-shared', diff --git a/tests/setuptools_golang_test.py b/tests/setuptools_golang_test.py index afb6d60..82fd8de 100644 --- a/tests/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -26,8 +26,8 @@ def run(*cmd, **kwargs): returncode = kwargs.pop('returncode', 0) proc = subprocess.Popen(cmd, **kwargs) out, err = proc.communicate() - out = out.decode('UTF-8') if out is not None else None - err = err.decode('UTF-8') if err is not None else None + out = out.decode('UTF-8').replace('\r', '') if out is not None else None + err = err.decode('UTF-8').replace('\r', '') if err is not None else None if returncode is not None: if proc.returncode != returncode: raise AssertionError( @@ -56,9 +56,10 @@ def venv(tmpdir_factory): """A shared virtualenv fixture, be careful not to install two of the same package into this -- or sadness... """ + bin = 'Scripts' if sys.platform == 'win32' else 'bin' venv = tmpdir_factory.mktemp('venv').join('venv') - pip = venv.join('bin/pip').strpath - python = venv.join('bin/python').strpath + pip = venv.join(bin, 'pip').strpath + python = venv.join(bin, 'python').strpath # Make sure this virtualenv has the same executable run('virtualenv', venv.strpath, '-p', sys.executable) # Install this so we can get coverage @@ -74,9 +75,9 @@ def venv(tmpdir_factory): @pytest.mark.parametrize( ('pkg', 'mod'), ( - ('testing/sum', 'sum'), - ('testing/sum_pure_go', 'sum_pure_go'), - ('testing/sum_sub_package', 'sum_sub_package.sum'), + (os.path.join('testing', 'sum'), 'sum'), + (os.path.join('testing', 'sum_pure_go'), 'sum_pure_go'), + (os.path.join('testing', 'sum_sub_package'), 'sum_sub_package.sum'), ), ) def test_sum_integration(venv, pkg, mod): @@ -90,7 +91,8 @@ def test_sum_integration(venv, pkg, mod): def test_integration_project_with_c(venv): test_sum_integration( - venv, 'testing/project_with_c', 'project_with_c_sum.sum', + venv, + os.path.join('testing', 'project_with_c'), 'project_with_c_sum.sum', ) out = run_output(venv.python, '-c', HELLO_WORLD) assert out == 'hello world\n' @@ -100,14 +102,14 @@ def test_integration_project_with_c(venv): def test_integration_imports_gh(venv): - run(venv.pip, 'install', 'testing/imports_gh') + run(venv.pip, 'install', os.path.join('testing', 'imports_gh')) out = run_output(venv.python, '-c', RED) assert out == '\x1b[31mohai\x1b[0m\n' def test_integration_notfound(venv): ret = run( - venv.pip, 'install', 'testing/notfound', + venv.pip, 'install', os.path.join('testing', 'notfound'), returncode=None, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, ) assert ret.returncode != 0 @@ -119,7 +121,7 @@ def test_integration_notfound(venv): def test_integration_multidir(venv): ret = run( - venv.pip, 'install', 'testing/multidir', + venv.pip, 'install', os.path.join('testing', 'multidir'), returncode=None, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, ) assert ret.returncode != 0 @@ -133,6 +135,6 @@ def test_integration_multidir(venv): def test_integration_internal_imports(venv): - run(venv.pip, 'install', 'testing/internal_imports') + run(venv.pip, 'install', os.path.join('testing', 'internal_imports')) out = run_output(venv.python, '-c', OHAI) assert out == 'ohai, Anthony\n' From 96723ccd8096eb37e96e0b7f25a42f27977c3e84 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 8 Dec 2017 22:57:21 -0800 Subject: [PATCH 012/225] v1.2.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c849361..9a9123e 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ 'golang.' ), url='https://github.com/asottile/setuptools-golang', - version='1.1.0', + version='1.2.0', author='Anthony Sottile', author_email='asottile@umich.edu', classifiers=[ From ad7b2206a3c28144fb03d32caeb2170f62d327a1 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 21 Jan 2018 15:31:11 -0800 Subject: [PATCH 013/225] Replace deprecated yield_fixture with fixture Committed via https://github.com/asottile/all-repos --- tests/setuptools_golang_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/setuptools_golang_test.py b/tests/setuptools_golang_test.py index 82fd8de..ea41992 100644 --- a/tests/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -51,7 +51,7 @@ def test_sets_cmdclass(): assert dist.cmdclass['build_ext'] -@pytest.yield_fixture(scope='session') +@pytest.fixture(scope='session') def venv(tmpdir_factory): """A shared virtualenv fixture, be careful not to install two of the same package into this -- or sadness... From c479ce5ce98ad613463cf71cd97b7f841cec9565 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 1 Feb 2018 11:15:06 -0800 Subject: [PATCH 014/225] Change ignored cache dir for pytest 3.4.0 Committed via https://github.com/asottile/all-repos --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 45c9677..86c0fa2 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ .coverage .tox .venv.touch -/.cache +/.pytest_cache /build /venv* coverage-html From 63081f2ba42bde4e1436ae9e34991d30861e9485 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 9 Mar 2018 14:00:59 -0800 Subject: [PATCH 015/225] Exclude all setup.py files from coverage --- .coveragerc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 692fdc7..450f2ad 100644 --- a/.coveragerc +++ b/.coveragerc @@ -6,7 +6,7 @@ data_file = $TOP/.coverage omit = .tox/* /usr/* - setup.py + */setup.py [report] exclude_lines = From 8711d9edd4a5ad5d7c193e9303a154330209edf7 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 7 Mar 2018 17:42:31 -0800 Subject: [PATCH 016/225] Normalize git urls in pre-commit config Improves cache performance Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a736e65..420336f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ repos: -- repo: https://github.com/pre-commit/pre-commit-hooks.git +- repo: https://github.com/pre-commit/pre-commit-hooks sha: v0.9.1 hooks: - id: trailing-whitespace @@ -10,7 +10,7 @@ repos: - id: debug-statements - id: requirements-txt-fixer - id: flake8 -- repo: https://github.com/asottile/reorder_python_imports.git +- repo: https://github.com/asottile/reorder_python_imports sha: v0.3.5 hooks: - id: reorder-python-imports From 7900ce52b6ca68b5af7b0a6cdac7fecb1bb66b97 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 9 Mar 2018 14:26:49 -0800 Subject: [PATCH 017/225] Ran pre-commit autoupdate. Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 420336f..035ae83 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - sha: v0.9.1 + rev: v1.2.3 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -11,7 +11,7 @@ repos: - id: requirements-txt-fixer - id: flake8 - repo: https://github.com/asottile/reorder_python_imports - sha: v0.3.5 + rev: v1.0.1 hooks: - id: reorder-python-imports - repo: local From ee96162487af3d226b09b9fac7fcd956e25a37d3 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 25 Mar 2018 16:26:25 -0700 Subject: [PATCH 018/225] Improve wheel building --- setuptools_golang.py | 54 ++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index dd7b423..c4452c2 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -1,6 +1,7 @@ from __future__ import print_function from __future__ import unicode_literals +import argparse import contextlib import copy import io @@ -145,11 +146,36 @@ def set_build_ext(dist, attr, value): dist.cmdclass['build_ext'] = _get_build_ext_cls(base, root) -GOLANG = 'https://storage.googleapis.com/golang/go1.7.5.linux-amd64.tar.gz' -WHEEL_ARGS = '--no-deps --wheel-dir /tmp /dist/*.tar.gz' +GOLANG = 'https://storage.googleapis.com/golang/go{}.linux-amd64.tar.gz' +SCRIPT = '''\ +cd /tmp +curl {golang} --silent --location | tar -xz +# TODO: GOROOT is only needed for go<=1.8 +export GOROOT=/tmp/go +export PATH="$GOROOT/bin:$PATH" +for py in {pythons}; do + "/opt/python/$py/bin/pip" wheel --no-deps --wheel-dir /tmp /dist/*.tar.gz +done +ls *.whl | xargs -n1 --verbose auditwheel repair --wheel-dir /dist +ls -al /dist +''' def build_manylinux_wheels(argv=None): # pragma: no cover + parser = argparse.ArgumentParser() + parser.add_argument( + '--golang', default='1.10', + help='Override golang version (default %(default)s)', + ) + parser.add_argument( + '--pythons', default='cp27-cp27mu,cp35-cp35m,cp36-cp36m', + help='Override pythons to build (default %(default)s)', + ) + args = parser.parse_args(argv) + + golang = GOLANG.format(args.golang) + pythons = ' '.join(args.pythons.split(',')) + assert os.path.exists('setup.py') if os.path.exists('dist'): shutil.rmtree('dist') @@ -157,28 +183,12 @@ def build_manylinux_wheels(argv=None): # pragma: no cover _check_call(('python', 'setup.py', 'sdist'), cwd='.', env={}) _check_call( ( - 'docker', 'run', + 'docker', 'run', '--rm', '--volume', '{}:/dist:rw'.format(os.path.abspath('dist')), - # I'd use --user, but this breaks git: - # http://stackoverflow.com/a/20272540/812183 - '--env', 'UID={}'.format(os.getuid()), - '--env', 'GID={}'.format(os.getgid()), + '--user', '{}:{}'.format(os.getuid(), os.getgid()), 'quay.io/pypa/manylinux1_x86_64:latest', - 'bash', '-exc', - 'cd /tmp\n' - 'wget {golang} -q --no-check-certificate -O /tmp/golang.tar.gz\n' - 'tar -xf /tmp/golang.tar.gz\n' - 'export GOROOT=/tmp/go\n' - 'export PATH="$GOROOT/bin:$PATH"\n' - '/opt/python/cp27-cp27mu/bin/pip wheel {wheel_args}\n' - '/opt/python/cp34-cp34m/bin/pip wheel {wheel_args}\n' - '/opt/python/cp35-cp35m/bin/pip wheel {wheel_args}\n' - '/opt/python/cp36-cp36m/bin/pip wheel {wheel_args}\n' - 'mkdir /tmp/whls\n' - 'ls *.whl | xargs -n1 --verbose auditwheel repair -w /tmp/whls\n' - 'cp /tmp/whls/* /dist\n' - 'chown "$UID:$GID" /dist/*\n' - 'ls /dist -al\n'.format(golang=GOLANG, wheel_args=WHEEL_ARGS), + 'bash', '-o', 'pipefail', '-euxc', + SCRIPT.format(golang=golang, pythons=pythons), ), cwd='.', env={}, ) From 3bc943cee47d9b526c3a9022c827ffd60fdb65ce Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 25 Mar 2018 16:35:04 -0700 Subject: [PATCH 019/225] Test against newer go versions --- .travis.yml | 10 +++++----- README.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 62c0e14..5748277 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,13 @@ language: python matrix: include: - - env: TOXENV=py27 GO=1.6 - - env: TOXENV=py27 GO=1.7 - - env: TOXENV=py35 GO=1.7 + - env: TOXENV=py27 GO=1.9 + - env: TOXENV=py27 GO=1.10 + - env: TOXENV=py35 GO=1.10 python: 3.5 - - env: TOXENV=py36 GO=1.7 + - env: TOXENV=py36 GO=1.10 python: 3.6 - - env: TOXENV=pypy GO=1.7 + - env: TOXENV=pypy GO=1.10 python: pypy install: - eval "$(gimme $GO)" diff --git a/README.md b/README.md index c2970f6..97e4e5d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A setuptools extension for building cpython extensions written in golang. ## Requirements -This requires golang >= 1.5. It is currently tested against 1.6 and 1.7. +This requires golang >= 1.5. It is currently tested against 1.9 and 1.10. This requires python >= 2.7. It is currently tested against 2.7, 3.5, 3.6, and pypy. From 1d69151cda08b2a7f42a45b8554ec338408c8e39 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 25 Mar 2018 17:16:59 -0700 Subject: [PATCH 020/225] v1.3.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9a9123e..bae5794 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ 'golang.' ), url='https://github.com/asottile/setuptools-golang', - version='1.2.0', + version='1.3.0', author='Anthony Sottile', author_email='asottile@umich.edu', classifiers=[ From 35bf8489ffeb5983bf5cbf2ed31c2afc047c7db6 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 30 Apr 2018 09:32:59 -0400 Subject: [PATCH 021/225] Replace legacy wheel metadata Committed via https://github.com/asottile/all-repos --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index e57d130..2be6836 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,2 @@ -[wheel] +[bdist_wheel] universal = True From af2e792af031deca4b686d8b39213a9f0225b7eb Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 21 May 2018 08:52:47 -0700 Subject: [PATCH 022/225] Use go 1.10 in appveyor --- appveyor.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 1da6e36..14644cf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,11 +4,8 @@ environment: - PYTHON: 'C:\Python36' install: -- 'SET PATH=%PYTHON%;%PYTHON%\Scripts;C:\MinGW\bin;C:\go-src\bin;%PATH%' -- 'SET GOROOT=C:\go-src' -- 'SET GOROOT_BOOTSTRAP=C:\go19-x86' -- 'git clone --branch=go1.10beta1 --depth=1 https://github.com/golang/go C:\go-src' -- 'cd C:\go-src\src && make.bat' +- 'SET PATH=%PYTHON%;%PYTHON%\Scripts;C:\MinGW\bin;C:\go110-x86\bin;%PATH%' +- 'SET GOROOT=C:\go110-x86' - 'pip install pytest' # Not a C# project From 98c68d5722caa5f5a5a2bf0e4494186848f07f9c Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 23 May 2018 17:29:35 -0700 Subject: [PATCH 023/225] Remove (unused) Makefile Committed via https://github.com/asottile/all-repos --- Makefile | 23 ----------------------- tox.ini | 5 ----- 2 files changed, 28 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index a27d50a..0000000 --- a/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -REBUILD_FLAG = - -.PHONY: all -all: venv test - -.PHONY: venv -venv: .venv.touch - tox -e venv $(REBUILD_FLAG) - -.PHONY: test -test: .venv.touch - tox $(REBUILD_FLAG) - -.venv.touch: setup.py requirements-dev.txt - $(eval REBUILD_FLAG := --recreate) - touch .venv.touch - -.PHONY: clean -clean: - find -name '*.pyc' -delete - rm -rf .tox - rm -rf ./venv-* - rm -f .venv.touch diff --git a/tox.ini b/tox.ini index 1b180d5..2a8ce29 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,4 @@ [tox] -project = setuptools-golang # These should match the travis env list envlist = py27,py35,py36,pypy @@ -15,9 +14,5 @@ commands = pre-commit install -f --install-hooks pre-commit run --all-files -[testenv:venv] -envdir = venv-{[tox]project} -commands = - [pep8] ignore = E265,E309,E501 From 79e72b2c35cedaf11f5a099c960eb3bd7c3c321f Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 1 Jun 2018 13:39:04 -0700 Subject: [PATCH 024/225] E309 is no longer rewritten by autopep8 Committed via https://github.com/asottile/all-repos --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 2a8ce29..6cf6b7f 100644 --- a/tox.ini +++ b/tox.ini @@ -15,4 +15,4 @@ commands = pre-commit run --all-files [pep8] -ignore = E265,E309,E501 +ignore = E265,E501 From ee50d0e4f908e8c67f283cef6810a177b8e6f83b Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 30 Jun 2018 19:02:00 -0700 Subject: [PATCH 025/225] Add cp37-cp37m --- setuptools_golang.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index c4452c2..b466c3f 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -168,7 +168,7 @@ def build_manylinux_wheels(argv=None): # pragma: no cover help='Override golang version (default %(default)s)', ) parser.add_argument( - '--pythons', default='cp27-cp27mu,cp35-cp35m,cp36-cp36m', + '--pythons', default='cp27-cp27mu,cp35-cp35m,cp36-cp36m,cp37-cp37m', help='Override pythons to build (default %(default)s)', ) args = parser.parse_args(argv) From 7cff629cf40f42477352fa282fb9940f6403fe40 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 10 Jul 2018 13:13:14 -0700 Subject: [PATCH 026/225] Use python3.7 in appveyor Committed via https://github.com/asottile/all-repos --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 14644cf..4644817 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ environment: matrix: - PYTHON: 'C:\Python27' - - PYTHON: 'C:\Python36' + - PYTHON: 'C:\Python37' install: - 'SET PATH=%PYTHON%;%PYTHON%\Scripts;C:\MinGW\bin;C:\go110-x86\bin;%PATH%' From a10b75236f0299e6dac26bb04cf93b258bd6cbae Mon Sep 17 00:00:00 2001 From: Jonathan Koch Date: Wed, 22 Aug 2018 15:34:26 +0200 Subject: [PATCH 027/225] Fix 'setup.py build' when encountering a dangling symlink --- setuptools_golang.py | 2 +- testing/dangling_symlink/dangling | 1 + testing/dangling_symlink/fake.go | 3 +++ testing/dangling_symlink/setup.py | 13 +++++++++++++ tests/setuptools_golang_test.py | 5 +++++ 5 files changed, 23 insertions(+), 1 deletion(-) create mode 120000 testing/dangling_symlink/dangling create mode 100644 testing/dangling_symlink/fake.go create mode 100644 testing/dangling_symlink/setup.py diff --git a/setuptools_golang.py b/setuptools_golang.py index b466c3f..47fe49e 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -113,7 +113,7 @@ def _raise_error(msg): root_path = os.path.join(tempdir, 'src', root) # Make everything but the last directory (copytree interface) os.makedirs(os.path.dirname(root_path)) - shutil.copytree('.', root_path) + shutil.copytree('.', root_path, symlinks=True) pkg_path = os.path.join(root_path, main_dir) env = {str('GOPATH'): tempdir} diff --git a/testing/dangling_symlink/dangling b/testing/dangling_symlink/dangling new file mode 120000 index 0000000..ee1f6cb --- /dev/null +++ b/testing/dangling_symlink/dangling @@ -0,0 +1 @@ +does_not_exist \ No newline at end of file diff --git a/testing/dangling_symlink/fake.go b/testing/dangling_symlink/fake.go new file mode 100644 index 0000000..38dd16d --- /dev/null +++ b/testing/dangling_symlink/fake.go @@ -0,0 +1,3 @@ +package main + +func main() {} diff --git a/testing/dangling_symlink/setup.py b/testing/dangling_symlink/setup.py new file mode 100644 index 0000000..502822b --- /dev/null +++ b/testing/dangling_symlink/setup.py @@ -0,0 +1,13 @@ +from setuptools import Extension +from setuptools import setup + + +setup( + name='fake', + ext_modules=[Extension('fake', ['fake.go'])], + build_golang={'root': 'github.com/asottile/fake'}, + # Would do this, but we're testing *our* implementation and this would + # install from pypi. We can rely on setuptools-golang being already + # installed under test. + # setup_requires=['setuptools-golang'], +) diff --git a/tests/setuptools_golang_test.py b/tests/setuptools_golang_test.py index ea41992..794e52a 100644 --- a/tests/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -138,3 +138,8 @@ def test_integration_internal_imports(venv): run(venv.pip, 'install', os.path.join('testing', 'internal_imports')) out = run_output(venv.python, '-c', OHAI) assert out == 'ohai, Anthony\n' + + +def test_regression_dangling_symlink(venv): + # this raises an error because of a dangling symlink + run(venv.pip, 'install', os.path.join('testing', 'dangling_symlink')) From 03d347a5900d1e2f749c628953beee9ebe52d817 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 22 Aug 2018 07:40:38 -0700 Subject: [PATCH 028/225] v1.3.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index bae5794..30d70bb 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ 'golang.' ), url='https://github.com/asottile/setuptools-golang', - version='1.3.0', + version='1.3.1', author='Anthony Sottile', author_email='asottile@umich.edu', classifiers=[ From f6707fe05051802993d0235fc09fd959c85c689b Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 1 Sep 2018 15:34:17 -0700 Subject: [PATCH 029/225] Updates for go 1.11 --- .travis.yml | 8 +++----- README.md | 4 ++-- appveyor.yml | 4 ++-- setuptools_golang.py | 4 +--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5748277..fb95392 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,11 @@ language: python matrix: include: - - env: TOXENV=py27 GO=1.9 - env: TOXENV=py27 GO=1.10 - - env: TOXENV=py35 GO=1.10 - python: 3.5 - - env: TOXENV=py36 GO=1.10 + - env: TOXENV=py27 GO=1.11 + - env: TOXENV=py36 GO=1.11 python: 3.6 - - env: TOXENV=pypy GO=1.10 + - env: TOXENV=pypy GO=1.11 python: pypy install: - eval "$(gimme $GO)" diff --git a/README.md b/README.md index 97e4e5d..24900fd 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ A setuptools extension for building cpython extensions written in golang. ## Requirements -This requires golang >= 1.5. It is currently tested against 1.9 and 1.10. +This requires golang >= 1.5. It is currently tested against 1.10 and 1.11. -This requires python >= 2.7. It is currently tested against 2.7, 3.5, 3.6, +This requires python >= 2.7. It is currently tested against 2.7, 3.6, 3.7, and pypy. ## Platform Support diff --git a/appveyor.yml b/appveyor.yml index 4644817..96c1ac7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,8 +4,8 @@ environment: - PYTHON: 'C:\Python37' install: -- 'SET PATH=%PYTHON%;%PYTHON%\Scripts;C:\MinGW\bin;C:\go110-x86\bin;%PATH%' -- 'SET GOROOT=C:\go110-x86' +- 'SET PATH=%PYTHON%;%PYTHON%\Scripts;C:\MinGW\bin;C:\go-x86\bin;%PATH%' +- 'SET GOROOT=C:\go-x86' - 'pip install pytest' # Not a C# project diff --git a/setuptools_golang.py b/setuptools_golang.py index 47fe49e..7bdf4f4 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -150,8 +150,6 @@ def set_build_ext(dist, attr, value): SCRIPT = '''\ cd /tmp curl {golang} --silent --location | tar -xz -# TODO: GOROOT is only needed for go<=1.8 -export GOROOT=/tmp/go export PATH="$GOROOT/bin:$PATH" for py in {pythons}; do "/opt/python/$py/bin/pip" wheel --no-deps --wheel-dir /tmp /dist/*.tar.gz @@ -164,7 +162,7 @@ def set_build_ext(dist, attr, value): def build_manylinux_wheels(argv=None): # pragma: no cover parser = argparse.ArgumentParser() parser.add_argument( - '--golang', default='1.10', + '--golang', default='1.11', help='Override golang version (default %(default)s)', ) parser.add_argument( From 47694e910151d833212c6063f6fced0738c43b6d Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 1 Sep 2018 15:43:19 -0700 Subject: [PATCH 030/225] v1.4.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 30d70bb..d22ce0f 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ 'golang.' ), url='https://github.com/asottile/setuptools-golang', - version='1.3.1', + version='1.4.0', author='Anthony Sottile', author_email='asottile@umich.edu', classifiers=[ From 569ea9cd4b06ee4e48f00b56336b6af133394630 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 12 Oct 2018 20:05:35 -0700 Subject: [PATCH 031/225] Migrate from autopep8-wrapper to mirrors-autopep8 Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 035ae83..fec48a1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,17 +1,20 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v1.2.3 + rev: v2.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - - id: autopep8-wrapper - id: check-docstring-first - id: check-yaml - id: debug-statements - id: requirements-txt-fixer - id: flake8 +- repo: https://github.com/pre-commit/mirrors-autopep8 + rev: v1.4 + hooks: + - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports - rev: v1.0.1 + rev: v1.3.0 hooks: - id: reorder-python-imports - repo: local From eed2481ee95257b4e6cf1889d49b772f62e4d038 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 8 Dec 2018 19:53:40 -0800 Subject: [PATCH 032/225] Fix wheel builder --- setuptools_golang.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index 7bdf4f4..5666ccf 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -150,7 +150,7 @@ def set_build_ext(dist, attr, value): SCRIPT = '''\ cd /tmp curl {golang} --silent --location | tar -xz -export PATH="$GOROOT/bin:$PATH" +export PATH="/tmp/go/bin:$PATH" for py in {pythons}; do "/opt/python/$py/bin/pip" wheel --no-deps --wheel-dir /tmp /dist/*.tar.gz done From fe4aa2d49d32847f89ea59b0c4578d6e7c1ce97b Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 8 Dec 2018 19:53:56 -0800 Subject: [PATCH 033/225] v1.4.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d22ce0f..4328fdf 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ 'golang.' ), url='https://github.com/asottile/setuptools-golang', - version='1.4.0', + version='1.4.1', author='Anthony Sottile', author_email='asottile@umich.edu', classifiers=[ From fdfb9daed3f93d52c580742ed746d06a3907b484 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 29 Jan 2019 22:09:06 -0800 Subject: [PATCH 034/225] Add W504 to ignored autopep8 rules Committed via https://github.com/asottile/all-repos --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 6cf6b7f..ace86c1 100644 --- a/tox.ini +++ b/tox.ini @@ -15,4 +15,4 @@ commands = pre-commit run --all-files [pep8] -ignore = E265,E501 +ignore = E265,E501,W504 From 25a0a48bf8e63c94c09625b23d6abe66a4949e2a Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 30 Jan 2019 00:35:27 -0800 Subject: [PATCH 035/225] Migrate to official pycqa/flake8 hooks repo Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fec48a1..f0ef65d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.0.0 + rev: v2.1.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -8,13 +8,16 @@ repos: - id: check-yaml - id: debug-statements - id: requirements-txt-fixer +- repo: https://gitlab.com/pycqa/flake8 + rev: 3.7.1 + hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.4 + rev: v1.4.3 hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports - rev: v1.3.0 + rev: v1.3.5 hooks: - id: reorder-python-imports - repo: local From 8f3f887de1a35433d633da685ab4d311fac0b801 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 27 Feb 2019 22:11:33 -0800 Subject: [PATCH 036/225] Migrate setup.py to setup.cfg declarative metadata Committed via https://github.com/asottile/all-repos --- setup.cfg | 34 ++++++++++++++++++++++++++++++++++ setup.py | 35 +---------------------------------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/setup.cfg b/setup.cfg index 2be6836..bde6bb0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,36 @@ +[metadata] +name = setuptools_golang +version = 1.4.1 +description = A setuptools extension for building cpython extensions written in golang. +long_description = file: README.md +long_description_content_type = text/markdown +url = https://github.com/asottile/setuptools-golang +author = Anthony Sottile +author_email = asottile@umich.edu +license = MIT +license_file = LICENSE +classifiers = + License :: OSI Approved :: MIT License + Programming Language :: Python :: 2 + 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 :: Implementation :: CPython + Programming Language :: Python :: Implementation :: PyPy + +[options] +py_modules = setuptools_golang +install_requires = +python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* + +[options.entry_points] +console_scripts = + setuptools-golang-build-manylinux-wheels = setuptools_golang:build_manylinux_wheels +distutils.setup_keywords = + build_golang = setuptools_golang:set_build_ext + [bdist_wheel] universal = True diff --git a/setup.py b/setup.py index 4328fdf..8bf1ba9 100644 --- a/setup.py +++ b/setup.py @@ -1,35 +1,2 @@ from setuptools import setup - - -setup( - name='setuptools-golang', - description=( - 'A setuptools extension for building cpython extensions written in ' - 'golang.' - ), - url='https://github.com/asottile/setuptools-golang', - version='1.4.1', - author='Anthony Sottile', - author_email='asottile@umich.edu', - classifiers=[ - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - ], - py_modules=['setuptools_golang'], - install_requires=[], - entry_points={ - 'console_scripts': [ - 'setuptools-golang-build-manylinux-wheels = ' - 'setuptools_golang:build_manylinux_wheels', - ], - 'distutils.setup_keywords': [ - 'build_golang = setuptools_golang:set_build_ext', - ], - }, -) +setup() From f98c7375733ecb97f98222d38835accb827bc014 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 27 Feb 2019 23:35:00 -0800 Subject: [PATCH 037/225] v1.5.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index bde6bb0..82caf3a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 1.4.1 +version = 1.5.0 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From b8321d11b9f664ab52597b452fe6be50ee5e0c82 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 7 Mar 2019 19:35:25 -0800 Subject: [PATCH 038/225] Fix setuptools-golang-build-manylinux-wheels for go 1.12 --- setuptools_golang.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index 5666ccf..ff87bad 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -150,7 +150,7 @@ def set_build_ext(dist, attr, value): SCRIPT = '''\ cd /tmp curl {golang} --silent --location | tar -xz -export PATH="/tmp/go/bin:$PATH" +export PATH="/tmp/go/bin:$PATH" HOME=/tmp for py in {pythons}; do "/opt/python/$py/bin/pip" wheel --no-deps --wheel-dir /tmp /dist/*.tar.gz done @@ -162,7 +162,7 @@ def set_build_ext(dist, attr, value): def build_manylinux_wheels(argv=None): # pragma: no cover parser = argparse.ArgumentParser() parser.add_argument( - '--golang', default='1.11', + '--golang', default='1.12', help='Override golang version (default %(default)s)', ) parser.add_argument( From 51702817353bc785f232e53c6216b5361027a560 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 7 Mar 2019 19:48:22 -0800 Subject: [PATCH 039/225] v1.5.1 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 82caf3a..cfa05c6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 1.5.0 +version = 1.5.1 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From d229c9a7a05edbfaf079d0ac6d7605a78334eb26 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 21 Apr 2019 16:10:54 -0700 Subject: [PATCH 040/225] Trim passenv (tox>=2.8) Committed via https://github.com/asottile/all-repos --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index ace86c1..9163e4c 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,6 @@ envlist = py27,py35,py36,pypy [testenv] deps = -rrequirements-dev.txt -passenv = HOME GOROOT setenv = TOP={toxinidir} commands = coverage erase From 7da51430dbfc7a84485cb949b5b840ef60fab9c9 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 21 Oct 2019 16:27:41 -0700 Subject: [PATCH 041/225] Update the default python versions for wheel building --- setuptools_golang.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index ff87bad..a90a472 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -166,7 +166,7 @@ def build_manylinux_wheels(argv=None): # pragma: no cover help='Override golang version (default %(default)s)', ) parser.add_argument( - '--pythons', default='cp27-cp27mu,cp35-cp35m,cp36-cp36m,cp37-cp37m', + '--pythons', default='cp27-cp27mu,cp36-cp36m,cp37-cp37m,cp38-cp38', help='Override pythons to build (default %(default)s)', ) args = parser.parse_args(argv) From 1bb9a17a5ee6178364165b946803a2769671f9c7 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 21 Oct 2019 16:39:52 -0700 Subject: [PATCH 042/225] v1.6.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index cfa05c6..42b17f7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 1.5.1 +version = 1.6.0 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From d4d75f6cb40e4be6626d53c9fb21a532346b2d42 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 11 Nov 2019 20:25:24 -0800 Subject: [PATCH 043/225] azure pipelines [skip travis] --- .coveragerc | 4 ++-- .travis.yml | 18 ----------------- README.md | 4 ++-- azure-pipelines.yml | 34 +++++++++++++++++++++++++++++++++ tests/setuptools_golang_test.py | 1 - tox.ini | 15 +++++++++------ 6 files changed, 47 insertions(+), 29 deletions(-) delete mode 100644 .travis.yml create mode 100644 azure-pipelines.yml diff --git a/.coveragerc b/.coveragerc index 450f2ad..df0f677 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,8 +1,8 @@ [run] parallel = True branch = True -source = $TOP -data_file = $TOP/.coverage +source = $PWD +data_file = $PWD/.coverage omit = .tox/* /usr/* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fb95392..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: python -matrix: - include: - - env: TOXENV=py27 GO=1.10 - - env: TOXENV=py27 GO=1.11 - - env: TOXENV=py36 GO=1.11 - python: 3.6 - - env: TOXENV=pypy GO=1.11 - python: pypy -install: - - eval "$(gimme $GO)" - - pip install coveralls tox -script: tox -after_success: TOP=. coveralls -cache: - directories: - - $HOME/.cache/pip - - $HOME/.cache/pre-commit diff --git a/README.md b/README.md index 24900fd..43e39b8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -[![Build Status](https://travis-ci.org/asottile/setuptools-golang.svg?branch=master)](https://travis-ci.org/asottile/setuptools-golang) +[![Build Status](https://dev.azure.com/asottile/asottile/_apis/build/status/asottile.setuptools-golang?branchName=master)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=52&branchName=master) [![Build status](https://ci.appveyor.com/api/projects/status/j4i2pc4o7pby3wdn/branch/master?svg=true)](https://ci.appveyor.com/project/asottile/setuptools-golang/branch/master) -[![Coverage Status](https://img.shields.io/coveralls/asottile/setuptools-golang.svg?branch=master)](https://coveralls.io/r/asottile/setuptools-golang) +[![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/asottile/asottile/52/master.svg)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=52&branchName=master) setuptools-golang ================= diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..d240ca4 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,34 @@ +trigger: + branches: + include: [master, test-me-*] + tags: + include: ['*'] + +resources: + repositories: + - repository: asottile + type: github + endpoint: github + name: asottile/azure-pipeline-templates + ref: refs/tags/v1.0.0 + +jobs: +- template: job--pre-commit.yml@asottile +- template: job--python-tox.yml@asottile + parameters: + toxenvs: [py38] + os: linux + name_postfix: _go_1_12 + pre_test: + - task: GoTool@0 + inputs: + version: '1.12' +- template: job--python-tox.yml@asottile + parameters: + toxenvs: [pypy, pypy3, py27, py36, py37, py38] + os: linux + name_postfix: _go_1_13 + pre_test: + - task: GoTool@0 + inputs: + version: '1.13' diff --git a/tests/setuptools_golang_test.py b/tests/setuptools_golang_test.py index 794e52a..69b4b98 100644 --- a/tests/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -14,7 +14,6 @@ @pytest.fixture(autouse=True, scope='session') def enable_coverage_subprocesses(): here = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - os.environ['TOP'] = here os.environ['COVERAGE_PROCESS_START'] = os.path.join(here, '.coveragerc') diff --git a/tox.ini b/tox.ini index 9163e4c..be60a9c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,17 +1,20 @@ [tox] -# These should match the travis env list -envlist = py27,py35,py36,pypy +envlist = py27,py36,py37,py38,pypy,pypy3,pre-commit [testenv] deps = -rrequirements-dev.txt -setenv = TOP={toxinidir} +setenv = PWD={toxinidir} commands = coverage erase coverage run -m pytest {posargs:tests} coverage combine - coverage report --show-missing --fail-under 100 - pre-commit install -f --install-hooks - pre-commit run --all-files + coverage report --fail-under 100 + pre-commit install + +[testenv:pre-commit] +skip_install = true +deps = pre-commit +commands = pre-commit run --all-files --show-diff-on-failure [pep8] ignore = E265,E501,W504 From 6387dab6e0c7fe4905da61b2a79013d7714c7172 Mon Sep 17 00:00:00 2001 From: Alan Yee Date: Fri, 27 Dec 2019 09:42:35 -0800 Subject: [PATCH 044/225] Update README.md Minor detail additions --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 43e39b8..df1cc21 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,12 @@ A setuptools extension for building cpython extensions written in golang. This requires golang >= 1.5. It is currently tested against 1.10 and 1.11. This requires python >= 2.7. It is currently tested against 2.7, 3.6, 3.7, -and pypy. +3.8, and pypy. ## Platform Support - linux -- macos +- macOS - win32 (32 bit cpython, 32 bit go 1.10+) ## Usage From 184f297a098a13f5e58e58ff91acdacc8a82467d Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 27 Dec 2019 15:01:25 -0800 Subject: [PATCH 045/225] Don't bother showing exact versions that way this doesn't need an update again --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index df1cc21..846e006 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ A setuptools extension for building cpython extensions written in golang. This requires golang >= 1.5. It is currently tested against 1.10 and 1.11. -This requires python >= 2.7. It is currently tested against 2.7, 3.6, 3.7, -3.8, and pypy. +This requires python >= 2.7. It is currently tested against python2, +python3, and pypy. ## Platform Support From 561b61ad84ad12ed911323d96a9e215fca87abac Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 18 Feb 2020 13:34:44 -0800 Subject: [PATCH 046/225] Support define_macros attribute of Extension --- requirements-dev.txt | 1 - setup.cfg | 1 - setuptools_golang.py | 14 ++++++++++--- testing/defines/setup.py | 18 +++++++++++++++++ testing/defines/sum.c | 35 +++++++++++++++++++++++++++++++++ testing/defines/sum.go | 17 ++++++++++++++++ tests/setuptools_golang_test.py | 6 ++++++ 7 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 testing/defines/setup.py create mode 100644 testing/defines/sum.c create mode 100644 testing/defines/sum.go diff --git a/requirements-dev.txt b/requirements-dev.txt index aa5127b..b1c8a83 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,3 @@ --e . coverage-enable-subprocess pre-commit pytest diff --git a/setup.cfg b/setup.cfg index 42b17f7..63b05ca 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,7 +23,6 @@ classifiers = [options] py_modules = setuptools_golang -install_requires = python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* [options.entry_points] diff --git a/setuptools_golang.py b/setuptools_golang.py index a90a472..00d3171 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -30,8 +30,14 @@ def err(action, name, exc): # pragma: no cover (windows) shutil.rmtree(tempdir, onerror=err) -def _get_cflags(compiler): - return str(' ').join(str('-I{}').format(p) for p in compiler.include_dirs) +def _get_cflags(compiler, macros): + args = [str('-I{}').format(p) for p in compiler.include_dirs] + for macro_name, macro_value in macros: + if macro_value is None: + args.append(str('-D{}').format(macro_name)) + else: + args.append(str('-D{}={}').format(macro_name, macro_value)) + return str(' ').join(args) LFLAG_CLANG = '-Wl,-undefined,dynamic_lookup' @@ -121,7 +127,9 @@ def _raise_error(msg): _check_call(cmd_get, cwd=pkg_path, env=env) env.update({ - str('CGO_CFLAGS'): _get_cflags(self.compiler), + str('CGO_CFLAGS'): _get_cflags( + self.compiler, ext.define_macros or (), + ), str('CGO_LDFLAGS'): _get_ldflags(), }) cmd_build = ( diff --git a/testing/defines/setup.py b/testing/defines/setup.py new file mode 100644 index 0000000..802cd69 --- /dev/null +++ b/testing/defines/setup.py @@ -0,0 +1,18 @@ +from setuptools import Extension +from setuptools import setup + + +setup( + name='sum', + ext_modules=[ + Extension( + 'sum', ['sum.go'], + define_macros=[('SUM_A', None), ('SUM_B', '2')], + ), + ], + build_golang={'root': 'github.com/asottile/fake'}, + # Would do this, but we're testing *our* implementation and this would + # install from pypi. We can rely on setuptools-golang being already + # installed under test. + # setup_requires=['setuptools-golang'], +) diff --git a/testing/defines/sum.c b/testing/defines/sum.c new file mode 100644 index 0000000..1483c43 --- /dev/null +++ b/testing/defines/sum.c @@ -0,0 +1,35 @@ +#include + +/* Will come from go */ +PyObject* sum(PyObject* , PyObject*); + +/* To shim go's missing variadic function support */ +int PyArg_ParseTuple_ll(PyObject* args, long* a, long* b) { + return PyArg_ParseTuple(args, "ll", a, b); +} + +/* demo that macro_defines works */ +#if defined(SUM_A) && SUM_B >= 2 +static struct PyMethodDef methods[] = { + {"sum", (PyCFunction)sum, METH_VARARGS}, + {NULL, NULL} +}; +#endif + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef module = { + PyModuleDef_HEAD_INIT, + "sum", + NULL, + -1, + methods +}; + +PyMODINIT_FUNC PyInit_sum(void) { + return PyModule_Create(&module); +} +#else +PyMODINIT_FUNC initsum(void) { + Py_InitModule3("sum", methods, NULL); +} +#endif diff --git a/testing/defines/sum.go b/testing/defines/sum.go new file mode 100644 index 0000000..9fdd006 --- /dev/null +++ b/testing/defines/sum.go @@ -0,0 +1,17 @@ +package main + +// #include +// int PyArg_ParseTuple_ll(PyObject*, long*, long*); +import "C" + +//export sum +func sum(self *C.PyObject, args *C.PyObject) *C.PyObject { + var a C.long + var b C.long + if C.PyArg_ParseTuple_ll(args, &a, &b) == 0 { + return nil + } + return C.PyLong_FromLong(a + b) +} + +func main() {} diff --git a/tests/setuptools_golang_test.py b/tests/setuptools_golang_test.py index 69b4b98..6ff25e6 100644 --- a/tests/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -139,6 +139,12 @@ def test_integration_internal_imports(venv): assert out == 'ohai, Anthony\n' +def test_integration_defines(venv): + run(venv.pip, 'install', os.path.join('testing', 'defines')) + out = run_output(venv.python, '-c', SUM.format('sum')) + assert out == '3\n' + + def test_regression_dangling_symlink(venv): # this raises an error because of a dangling symlink run(venv.pip, 'install', os.path.join('testing', 'dangling_symlink')) From f1dc8e5e0da0dbb7e4c4cdd5dcc0bf620f273976 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 18 Feb 2020 14:22:21 -0800 Subject: [PATCH 047/225] v1.7.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 63b05ca..f9aae7d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 1.6.0 +version = 1.7.0 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From dcbc4100e923955fafe8ef0c1a92304dd0cbe6ed Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 18 Feb 2020 16:04:31 -0800 Subject: [PATCH 048/225] setuptools-golang: python3.6+ --- .gitignore | 13 ++-- .pre-commit-config.yaml | 28 ++++++-- appveyor.yml | 1 - azure-pipelines.yml | 8 +-- setup.cfg | 21 ++++-- setuptools_golang.py | 115 +++++++++++++++++++------------- testing/multidir/setup.py | 8 ++- tests/setuptools_golang_test.py | 7 +- tox.ini | 2 +- 9 files changed, 124 insertions(+), 79 deletions(-) diff --git a/.gitignore b/.gitignore index 86c0fa2..38f0e79 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,10 @@ *.egg-info -*.iml -*.py[cod] +*.pyc *.so -.*.sw[a-z] -.coverage -.tox -.venv.touch +/.coverage +/.mypy_cache /.pytest_cache +/.tox /build +/dist /venv* -coverage-html -dist diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f0ef65d..24d3244 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.1.0 + rev: v2.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -9,17 +9,37 @@ repos: - id: debug-statements - id: requirements-txt-fixer - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.1 + rev: 3.7.9 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.4.3 + rev: v1.5 hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports - rev: v1.3.5 + rev: v1.9.0 hooks: - id: reorder-python-imports + args: [--py3-plus] +- repo: https://github.com/asottile/pyupgrade + rev: v1.26.2 + hooks: + - id: pyupgrade + args: [--py36-plus] +- repo: https://github.com/asottile/add-trailing-comma + rev: v1.5.0 + hooks: + - id: add-trailing-comma + args: [--py36-plus] +- repo: https://github.com/asottile/setup-cfg-fmt + rev: v1.6.0 + hooks: + - id: setup-cfg-fmt +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.761 + hooks: + - id: mypy + exclude: ^testing/ - repo: local hooks: - id: gofmt diff --git a/appveyor.yml b/appveyor.yml index 96c1ac7..b2a6e50 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,5 @@ environment: matrix: - - PYTHON: 'C:\Python27' - PYTHON: 'C:\Python37' install: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d240ca4..d16cf0b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,7 +10,7 @@ resources: type: github endpoint: github name: asottile/azure-pipeline-templates - ref: refs/tags/v1.0.0 + ref: refs/tags/v1.0.1 jobs: - template: job--pre-commit.yml@asottile @@ -22,13 +22,13 @@ jobs: pre_test: - task: GoTool@0 inputs: - version: '1.12' + version: '1.12.17' - template: job--python-tox.yml@asottile parameters: - toxenvs: [pypy, pypy3, py27, py36, py37, py38] + toxenvs: [pypy3, py36, py37, py38] os: linux name_postfix: _go_1_13 pre_test: - task: GoTool@0 inputs: - version: '1.13' + version: '1.13.8' diff --git a/setup.cfg b/setup.cfg index f9aae7d..24ed6dd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,19 +11,17 @@ license = MIT license_file = LICENSE classifiers = License :: OSI Approved :: MIT License - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 - Programming Language :: Python :: 3.4 - Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3 :: Only 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 [options] py_modules = setuptools_golang -python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* +python_requires = >=3.6 [options.entry_points] console_scripts = @@ -33,3 +31,16 @@ distutils.setup_keywords = [bdist_wheel] universal = True + +[mypy] +check_untyped_defs = true +disallow_any_generics = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_optional = true + +[mypy-testing.*] +disallow_untyped_defs = false + +[mypy-tests.*] +disallow_untyped_defs = false diff --git a/setuptools_golang.py b/setuptools_golang.py index 00d3171..b12c05c 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -1,28 +1,38 @@ -from __future__ import print_function -from __future__ import unicode_literals - import argparse import contextlib import copy -import io import os -import pipes +import shlex import shutil import stat import subprocess import sys import tempfile - +from distutils.ccompiler import CCompiler +from distutils.dist import Distribution +from typing import Callable +from typing import Dict +from typing import Generator +from typing import Optional +from typing import Sequence +from typing import Tuple +from typing import Type + +from setuptools import Extension from setuptools.command.build_ext import build_ext as _build_ext @contextlib.contextmanager -def _tmpdir(): +def _tmpdir() -> Generator[str, None, None]: tempdir = tempfile.mkdtemp() try: yield tempdir finally: - def err(action, name, exc): # pragma: no cover (windows) + def err( + action: Callable[[str], None], + name: str, + exc: Exception, + ) -> None: # pragma: no cover (windows) """windows: can't remove readonly files, make them writeable!""" os.chmod(name, stat.S_IWRITE) action(name) @@ -30,14 +40,18 @@ def err(action, name, exc): # pragma: no cover (windows) shutil.rmtree(tempdir, onerror=err) -def _get_cflags(compiler, macros): - args = [str('-I{}').format(p) for p in compiler.include_dirs] +def _get_cflags( + compiler: CCompiler, + macros: Sequence[Tuple[str, Optional[str]]], +) -> str: + # https://github.com/python/typeshed/pull/3741 + args = [f'-I{p}' for p in compiler.include_dirs] # type: ignore for macro_name, macro_value in macros: if macro_value is None: - args.append(str('-D{}').format(macro_name)) + args.append(f'-D{macro_name}') else: - args.append(str('-D{}={}').format(macro_name, macro_value)) - return str(' ').join(args) + args.append(f'-D{macro_name}={macro_value}') + return ' '.join(args) LFLAG_CLANG = '-Wl,-undefined,dynamic_lookup' @@ -45,21 +59,21 @@ def _get_cflags(compiler, macros): LFLAGS = (LFLAG_CLANG, LFLAG_GCC) -def _get_ldflags(): +def _get_ldflags() -> str: """Determine the correct link flags. This attempts dummy compiles similar to how autotools does feature detection. """ # windows gcc does not support linking with unresolved symbols if sys.platform == 'win32': # pragma: no cover (windows) prefix = getattr(sys, 'real_prefix', sys.prefix) - libs = os.path.join(prefix, str('libs')) - return str('-L{} -lpython{}{}').format(libs, *sys.version_info[:2]) + libs = os.path.join(prefix, 'libs') + return '-L{} -lpython{}{}'.format(libs, *sys.version_info[:2]) cc = subprocess.check_output(('go', 'env', 'CC')).decode('UTF-8').strip() with _tmpdir() as tmpdir: testf = os.path.join(tmpdir, 'test.c') - with io.open(testf, 'w') as f: + with open(testf, 'w') as f: f.write('int f(int); int main(void) { return f(0); }\n') for lflag in LFLAGS: # pragma: no cover (platform specific) @@ -74,25 +88,20 @@ def _get_ldflags(): return LFLAG_GCC -def _check_call(cmd, cwd, env): - envparts = [ - '{}={}'.format(k, pipes.quote(v)) - for k, v in sorted(tuple(env.items())) - ] +def _check_call(cmd: Tuple[str, ...], cwd: str, env: Dict[str, str]) -> None: + envparts = [f'{k}={shlex.quote(v)}' for k, v in sorted(tuple(env.items()))] print( - '$ {}'.format(' '.join(envparts + [pipes.quote(p) for p in cmd])), + '$ {}'.format(' '.join(envparts + [shlex.quote(p) for p in cmd])), file=sys.stderr, ) subprocess.check_call(cmd, cwd=cwd, env=dict(os.environ, **env)) -def _get_build_extension_method(base, root): - def build_extension(self, ext): - def _raise_error(msg): - raise IOError( - 'Error building extension `{}`: '.format(ext.name) + msg, - ) - +def _get_build_extension_method( + base: Type[_build_ext], + root: str, +) -> Callable[[_build_ext, Extension], None]: + def build_extension(self: _build_ext, ext: Extension) -> None: # If there are no .go files then the parent should handle this if not any(source.endswith('.go') for source in ext.sources): # the base class may mutate `self.compiler` @@ -104,14 +113,18 @@ def _raise_error(msg): self.compiler, compiler = compiler, self.compiler if len(ext.sources) != 1: - _raise_error( - 'sources must be a single file in the `main` package.\n' - 'Recieved: {!r}'.format(ext.sources) + raise OSError( + f'Error building extension `{ext.name}`: ' + f'sources must be a single file in the `main` package.\n' + f'Recieved: {ext.sources!r}', ) main_file, = ext.sources if not os.path.exists(main_file): - _raise_error('{} does not exist'.format(main_file)) + raise OSError( + f'Error building extension `{ext.name}`: ' + f'{main_file} does not exist', + ) main_dir = os.path.dirname(main_file) # Copy the package into a temporary GOPATH environment @@ -122,15 +135,15 @@ def _raise_error(msg): shutil.copytree('.', root_path, symlinks=True) pkg_path = os.path.join(root_path, main_dir) - env = {str('GOPATH'): tempdir} + env = {'GOPATH': tempdir} cmd_get = ('go', 'get', '-d') _check_call(cmd_get, cwd=pkg_path, env=env) env.update({ - str('CGO_CFLAGS'): _get_cflags( + 'CGO_CFLAGS': _get_cflags( self.compiler, ext.define_macros or (), ), - str('CGO_LDFLAGS'): _get_ldflags(), + 'CGO_LDFLAGS': _get_ldflags(), }) cmd_build = ( 'go', 'build', '-buildmode=c-shared', @@ -141,17 +154,20 @@ def _raise_error(msg): return build_extension -def _get_build_ext_cls(base, root): - class build_ext(base): - build_extension = _get_build_extension_method(base, root) - - return build_ext +def _get_build_ext_cls(base: Type[_build_ext], root: str) -> Type[_build_ext]: + attrs = {'build_extension': _get_build_extension_method(base, root)} + return type('build_ext', (base,), attrs) -def set_build_ext(dist, attr, value): +def set_build_ext( + dist: Distribution, + attr: str, + value: Dict[str, str], +) -> None: root = value['root'] - base = dist.cmdclass.get('build_ext', _build_ext) - dist.cmdclass['build_ext'] = _get_build_ext_cls(base, root) + # https://github.com/python/typeshed/pull/3742 + base = dist.cmdclass.get('build_ext', _build_ext) # type: ignore + dist.cmdclass['build_ext'] = _get_build_ext_cls(base, root) # type: ignore GOLANG = 'https://storage.googleapis.com/golang/go{}.linux-amd64.tar.gz' @@ -167,7 +183,9 @@ def set_build_ext(dist, attr, value): ''' -def build_manylinux_wheels(argv=None): # pragma: no cover +def build_manylinux_wheels( + argv: Optional[Sequence[str]] = None, +) -> int: # pragma: no cover parser = argparse.ArgumentParser() parser.add_argument( '--golang', default='1.12', @@ -190,8 +208,8 @@ def build_manylinux_wheels(argv=None): # pragma: no cover _check_call( ( 'docker', 'run', '--rm', - '--volume', '{}:/dist:rw'.format(os.path.abspath('dist')), - '--user', '{}:{}'.format(os.getuid(), os.getgid()), + '--volume', f'{os.path.abspath("dist")}:/dist:rw' + '--user', f'{os.getuid()}:{os.getgid()}', 'quay.io/pypa/manylinux1_x86_64:latest', 'bash', '-o', 'pipefail', '-euxc', SCRIPT.format(golang=golang, pythons=pythons), @@ -201,3 +219,4 @@ def build_manylinux_wheels(argv=None): # pragma: no cover print('*' * 79) print('Your wheels have been built into ./dist') print('*' * 79) + return 0 diff --git a/testing/multidir/setup.py b/testing/multidir/setup.py index 1b77eca..0e26a0b 100644 --- a/testing/multidir/setup.py +++ b/testing/multidir/setup.py @@ -4,9 +4,11 @@ setup( name='multidir', - ext_modules=[Extension( - 'multidir', ['dir1/sum.go', 'dir2/sum_support.go'], - )], + ext_modules=[ + Extension( + 'multidir', ['dir1/sum.go', 'dir2/sum_support.go'], + ), + ], build_golang={'root': 'github.com/asottile/fake'}, # Would do this, but we're testing *our* implementation and this would # install from pypi. We can rely on setuptools-golang being already diff --git a/tests/setuptools_golang_test.py b/tests/setuptools_golang_test.py index 6ff25e6..8fcb584 100644 --- a/tests/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import collections import os import subprocess @@ -30,9 +28,8 @@ def run(*cmd, **kwargs): if returncode is not None: if proc.returncode != returncode: raise AssertionError( - '{!r} returned {} (expected {})\nout:\n{}\nerr:\n{}\n'.format( - cmd, proc.returncode, returncode, out, err, - ) + f'{cmd!r} returned {proc.returncode} (expected {returncode})\n' + f'out:\n{out}\nerr:\n{err}\n', ) return auto_namedtuple(returncode=proc.returncode, out=out, err=err) diff --git a/tox.ini b/tox.ini index be60a9c..71da12e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py36,py37,py38,pypy,pypy3,pre-commit +envlist = py36,py37,py38,pypy3,pre-commit [testenv] deps = -rrequirements-dev.txt From 17f937078945fd1faba2f4337be5210b50d1932c Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 18 Feb 2020 16:10:04 -0800 Subject: [PATCH 049/225] v2.0.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 24ed6dd..b557c66 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 1.7.0 +version = 2.0.0 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From 89125174ea8b4b7f91cc44ac56e9e5e81d47cd75 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 18 Feb 2020 17:50:23 -0800 Subject: [PATCH 050/225] v2.0.1 --- README.md | 4 +--- setup.cfg | 2 +- setuptools_golang.py | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 846e006..25f0965 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,7 @@ A setuptools extension for building cpython extensions written in golang. This requires golang >= 1.5. It is currently tested against 1.10 and 1.11. -This requires python >= 2.7. It is currently tested against python2, -python3, and pypy. +This requires python >= 3.6. It is currently tested against python3 and pypy3. ## Platform Support @@ -98,7 +97,6 @@ $ setuptools-golang-build-manylinux-wheels total 8092 drwxrwxr-x 2 1000 1000 4096 Feb 1 04:16 . drwxr-xr-x 41 root root 4096 Feb 1 04:15 .. --rw-r--r-- 1 1000 1000 2065095 Feb 1 04:16 setuptools_golang_examples-0.1.1-cp27-cp27mu-manylinux1_x86_64.whl -rw-r--r-- 1 1000 1000 2063299 Feb 1 04:16 setuptools_golang_examples-0.1.1-cp34-cp34m-manylinux1_x86_64.whl -rw-r--r-- 1 1000 1000 2064862 Feb 1 04:16 setuptools_golang_examples-0.1.1-cp35-cp35m-manylinux1_x86_64.whl -rw-r--r-- 1 1000 1000 2064873 Feb 1 04:16 setuptools_golang_examples-0.1.1-cp36-cp36m-manylinux1_x86_64.whl diff --git a/setup.cfg b/setup.cfg index b557c66..4079922 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 2.0.0 +version = 2.0.1 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown diff --git a/setuptools_golang.py b/setuptools_golang.py index b12c05c..9d7f07b 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -188,11 +188,11 @@ def build_manylinux_wheels( ) -> int: # pragma: no cover parser = argparse.ArgumentParser() parser.add_argument( - '--golang', default='1.12', + '--golang', default='1.13.8', help='Override golang version (default %(default)s)', ) parser.add_argument( - '--pythons', default='cp27-cp27mu,cp36-cp36m,cp37-cp37m,cp38-cp38', + '--pythons', default='cp36-cp36m,cp37-cp37m,cp38-cp38', help='Override pythons to build (default %(default)s)', ) args = parser.parse_args(argv) From 00b0051c5e6588ecb181da697fc20f28e0a4aa3d Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 24 Feb 2020 15:43:56 -0800 Subject: [PATCH 051/225] Require python3.6.1 [python 3 statement - 3.6.0](https://github.com/asottile/scratch/wiki/python-3-statement#360) (due to broken `NamedTuple` in 3.6.0) Committed via https://github.com/asottile/all-repos --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 4079922..841206f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,7 +21,7 @@ classifiers = [options] py_modules = setuptools_golang -python_requires = >=3.6 +python_requires = >=3.6.1 [options.entry_points] console_scripts = From 074d68fc9addba4d2848f06c052ef975b3a50174 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 24 Feb 2020 16:00:58 -0800 Subject: [PATCH 052/225] v2.1.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 841206f..9a67f8a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 2.0.1 +version = 2.1.0 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From 69c1547649ed5be80049dc19b049f5b1b289a78b Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 24 Feb 2020 20:48:45 -0800 Subject: [PATCH 053/225] Fix wheel building script --- setuptools_golang.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index 9d7f07b..d9a599f 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -208,7 +208,7 @@ def build_manylinux_wheels( _check_call( ( 'docker', 'run', '--rm', - '--volume', f'{os.path.abspath("dist")}:/dist:rw' + '--volume', f'{os.path.abspath("dist")}:/dist:rw', '--user', f'{os.getuid()}:{os.getgid()}', 'quay.io/pypa/manylinux1_x86_64:latest', 'bash', '-o', 'pipefail', '-euxc', From 1e508a4098bebe9ebbdfcb5fdbe399bcb40e3b2e Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 24 Feb 2020 20:49:03 -0800 Subject: [PATCH 054/225] v2.1.1 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 9a67f8a..7217d8e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 2.1.0 +version = 2.1.1 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From 231d3a7927b41a3153367bc7e555f08cc0bdff41 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 11 May 2020 14:11:27 -0700 Subject: [PATCH 055/225] Run pre-commit autoupdate Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 24d3244..e6c525d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,34 +9,34 @@ repos: - id: debug-statements - id: requirements-txt-fixer - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.9 + rev: 3.8.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.5 + rev: v1.5.2 hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports - rev: v1.9.0 + rev: v2.3.0 hooks: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v1.26.2 + rev: v2.4.1 hooks: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/asottile/add-trailing-comma - rev: v1.5.0 + rev: v2.0.1 hooks: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.6.0 + rev: v1.9.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.761 + rev: v0.770 hooks: - id: mypy exclude: ^testing/ From e547aede399f1cb58cb1bc795e2c41d8af648718 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 26 May 2020 21:54:52 -0700 Subject: [PATCH 056/225] slightly speed up tests by avoiding pre-commit install Committed via https://github.com/asottile/all-repos --- requirements-dev.txt | 1 - tox.ini | 1 - 2 files changed, 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b1c8a83..132f0c8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,2 @@ coverage-enable-subprocess -pre-commit pytest diff --git a/tox.ini b/tox.ini index 71da12e..d087056 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,6 @@ commands = coverage run -m pytest {posargs:tests} coverage combine coverage report --fail-under 100 - pre-commit install [testenv:pre-commit] skip_install = true From 93270047364c120223cb47d2f1c52c5e6a1ac3a4 Mon Sep 17 00:00:00 2001 From: Darragh Bailey Date: Tue, 22 Sep 2020 13:07:48 +0100 Subject: [PATCH 057/225] Include normal reset byte in test assertion Test for coloured output will fail due to a mismatch between what is generated and what is asserted. The generated output will contain a byte to set console output to normal before subsequently modifying it to be coloured red at normal intensity. Update the assertion to match. --- tests/setuptools_golang_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/setuptools_golang_test.py b/tests/setuptools_golang_test.py index 8fcb584..ead0420 100644 --- a/tests/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -100,7 +100,7 @@ def test_integration_project_with_c(venv): def test_integration_imports_gh(venv): run(venv.pip, 'install', os.path.join('testing', 'imports_gh')) out = run_output(venv.python, '-c', RED) - assert out == '\x1b[31mohai\x1b[0m\n' + assert out == '\x1b[0;31mohai\x1b[0m\n' def test_integration_notfound(venv): From 14be0c3b4c2650718c9c71826d1cd020fd3aeb28 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 22 Sep 2020 10:14:52 -0700 Subject: [PATCH 058/225] use covdefaults for coverage --- .coveragerc | 28 ---------------------------- requirements-dev.txt | 1 + setup.cfg | 6 ++++++ tests/setuptools_golang_test.py | 4 ++-- tox.ini | 2 +- 5 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index df0f677..0000000 --- a/.coveragerc +++ /dev/null @@ -1,28 +0,0 @@ -[run] -parallel = True -branch = True -source = $PWD -data_file = $PWD/.coverage -omit = - .tox/* - /usr/* - */setup.py - -[report] -exclude_lines = - # Have to re-enable the standard pragma - \#\s*pragma: no cover - - # Don't complain if tests don't hit defensive assertion code: - ^\s*raise AssertionError\b - ^\s*raise NotImplementedError\b - ^\s*return NotImplemented\b - ^\s*raise$ - - # Don't complain if non-runnable code isn't run: - ^if __name__ == ['"]__main__['"]:$ - -[html] -directory = coverage-html - -# vim:ft=dosini diff --git a/requirements-dev.txt b/requirements-dev.txt index 132f0c8..b8acb1f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,3 @@ +covdefaults>=1.2.0 coverage-enable-subprocess pytest diff --git a/setup.cfg b/setup.cfg index 7217d8e..3073f4a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,6 +32,12 @@ distutils.setup_keywords = [bdist_wheel] universal = True +[coverage:run] +plugins = covdefaults +parallel = True +source = $PWD +data_file = $PWD/.coverage + [mypy] check_untyped_defs = true disallow_any_generics = true diff --git a/tests/setuptools_golang_test.py b/tests/setuptools_golang_test.py index ead0420..eacf9a2 100644 --- a/tests/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -12,7 +12,7 @@ @pytest.fixture(autouse=True, scope='session') def enable_coverage_subprocesses(): here = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - os.environ['COVERAGE_PROCESS_START'] = os.path.join(here, '.coveragerc') + os.environ['COVERAGE_PROCESS_START'] = os.path.join(here, 'setup.cfg') def auto_namedtuple(**kwargs): @@ -59,7 +59,7 @@ def venv(tmpdir_factory): # Make sure this virtualenv has the same executable run('virtualenv', venv.strpath, '-p', sys.executable) # Install this so we can get coverage - run(pip, 'install', 'coverage-enable-subprocess') + run(pip, 'install', 'covdefaults>=1.2.0', 'coverage-enable-subprocess') # Install us! run(pip, 'install', '-e', '.') yield auto_namedtuple(venv=venv, pip=pip, python=python) diff --git a/tox.ini b/tox.ini index d087056..b8eb529 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ commands = coverage erase coverage run -m pytest {posargs:tests} coverage combine - coverage report --fail-under 100 + coverage report [testenv:pre-commit] skip_install = true From ca8ea7f679c45fb806d15b267e308fde04f9efd4 Mon Sep 17 00:00:00 2001 From: Darragh Bailey Date: Tue, 22 Sep 2020 18:43:37 +0100 Subject: [PATCH 059/225] Update golang used in CI to supported versions Golang 1.12 & 1.13 are no longer supported, update to golang 1.15 & 1.14. Only the 2 most recent minor releases are supported at a time for golang. --- azure-pipelines.yml | 8 ++++---- setuptools_golang.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d16cf0b..13194d0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,17 +18,17 @@ jobs: parameters: toxenvs: [py38] os: linux - name_postfix: _go_1_12 + name_postfix: _go_1_14 pre_test: - task: GoTool@0 inputs: - version: '1.12.17' + version: '1.14.8' - template: job--python-tox.yml@asottile parameters: toxenvs: [pypy3, py36, py37, py38] os: linux - name_postfix: _go_1_13 + name_postfix: _go_1_15 pre_test: - task: GoTool@0 inputs: - version: '1.13.8' + version: '1.15.1' diff --git a/setuptools_golang.py b/setuptools_golang.py index d9a599f..2b1b71b 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -188,7 +188,7 @@ def build_manylinux_wheels( ) -> int: # pragma: no cover parser = argparse.ArgumentParser() parser.add_argument( - '--golang', default='1.13.8', + '--golang', default='1.14.8', help='Override golang version (default %(default)s)', ) parser.add_argument( From 0a61e39fd6d2ea0cd5e9be617ccf8524ce33808b Mon Sep 17 00:00:00 2001 From: Darragh Bailey Date: Mon, 21 Sep 2020 22:06:06 +0100 Subject: [PATCH 060/225] Fix clean up of downloaded modules when using go.mod Projects that use go.mod will result in the build downloading the modules to an temporary path. Golang introduced read only directories to protect the generated module cache from accidental writes, resulting in failures to build when exiting the temporary directory context. Adapt the solution from pre-commit to make the directory and file writable on removal and include a rudimentary test that exercises download via a simple example module hosted by the golang org in github. Fixes #49 --- setuptools_golang.py | 34 +++++++++++++++++-------- testing/gomodules/go.mod | 5 ++++ testing/gomodules/go.sum | 2 ++ testing/gomodules/reversemsg.go | 19 ++++++++++++++ testing/gomodules/reversemsg_support.go | 29 +++++++++++++++++++++ testing/gomodules/setup.py | 15 +++++++++++ tests/setuptools_golang_test.py | 9 +++++++ 7 files changed, 103 insertions(+), 10 deletions(-) create mode 100644 testing/gomodules/go.mod create mode 100644 testing/gomodules/go.sum create mode 100644 testing/gomodules/reversemsg.go create mode 100644 testing/gomodules/reversemsg_support.go create mode 100644 testing/gomodules/setup.py diff --git a/setuptools_golang.py b/setuptools_golang.py index 2b1b71b..8dddd47 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -1,6 +1,7 @@ import argparse import contextlib import copy +import errno import os import shlex import shutil @@ -10,6 +11,8 @@ import tempfile from distutils.ccompiler import CCompiler from distutils.dist import Distribution +from types import TracebackType +from typing import Any from typing import Callable from typing import Dict from typing import Generator @@ -22,22 +25,33 @@ from setuptools.command.build_ext import build_ext as _build_ext +def rmtree(path: str) -> None: + """Newer golang uses readonly dirs & files for module cache.""" + def handle_remove_readonly( + func: Callable[..., Any], + path: str, + exc: Tuple[Type[OSError], OSError, TracebackType], + ) -> None: + excvalue = exc[1] + if ( + func in (os.rmdir, os.remove, os.unlink) and + excvalue.errno == errno.EACCES + ): + for p in (path, os.path.dirname(path)): + os.chmod(p, os.stat(p).st_mode | stat.S_IWUSR) + func(path) + else: + raise + shutil.rmtree(path, ignore_errors=False, onerror=handle_remove_readonly) + + @contextlib.contextmanager def _tmpdir() -> Generator[str, None, None]: tempdir = tempfile.mkdtemp() try: yield tempdir finally: - def err( - action: Callable[[str], None], - name: str, - exc: Exception, - ) -> None: # pragma: no cover (windows) - """windows: can't remove readonly files, make them writeable!""" - os.chmod(name, stat.S_IWRITE) - action(name) - - shutil.rmtree(tempdir, onerror=err) + rmtree(tempdir) def _get_cflags( diff --git a/testing/gomodules/go.mod b/testing/gomodules/go.mod new file mode 100644 index 0000000..a622a41 --- /dev/null +++ b/testing/gomodules/go.mod @@ -0,0 +1,5 @@ +module github.com/asottile/setuptools-golang/testing/gomodules + +go 1.14 + +require github.com/golang/example v0.0.0-20170904185048-46695d81d1fa diff --git a/testing/gomodules/go.sum b/testing/gomodules/go.sum new file mode 100644 index 0000000..6cb484e --- /dev/null +++ b/testing/gomodules/go.sum @@ -0,0 +1,2 @@ +github.com/golang/example v0.0.0-20170904185048-46695d81d1fa h1:iqCQC2Z53KkwGgTN9szyL4q0OQHmuNjeoNnMT6lk66k= +github.com/golang/example v0.0.0-20170904185048-46695d81d1fa/go.mod h1:tO/5UvQ/uKigUjQBPqzstj6uxd3fUIjddi19DxGJeWg= diff --git a/testing/gomodules/reversemsg.go b/testing/gomodules/reversemsg.go new file mode 100644 index 0000000..8e39a39 --- /dev/null +++ b/testing/gomodules/reversemsg.go @@ -0,0 +1,19 @@ +package main + +// #include +import "C" + +import ( + "fmt" + + "github.com/golang/example/stringutil" +) + +//export reversemsg +func reversemsg() *C.PyObject { + fmt.Print(stringutil.Reverse("elpmaxe tset")) + + return C.Py_None +} + +func main() {} diff --git a/testing/gomodules/reversemsg_support.go b/testing/gomodules/reversemsg_support.go new file mode 100644 index 0000000..377fd7d --- /dev/null +++ b/testing/gomodules/reversemsg_support.go @@ -0,0 +1,29 @@ +package main + +// #include +// +// PyObject* reversemsg(); +// +// static struct PyMethodDef methods[] = { +// {"reversemsg", (PyCFunction)reversemsg, METH_NOARGS}, +// {NULL, NULL} +// }; +// +// #if PY_MAJOR_VERSION >= 3 +// static struct PyModuleDef module = { +// PyModuleDef_HEAD_INIT, +// "gomodules", +// NULL, +// -1, +// methods +// }; +// +// PyMODINIT_FUNC PyInit_gomodules(void) { +// return PyModule_Create(&module); +// } +// #else +// PyMODINIT_FUNC initgomodules(void) { +// Py_InitModule3("gomodules", methods, NULL); +// } +// #endif +import "C" diff --git a/testing/gomodules/setup.py b/testing/gomodules/setup.py new file mode 100644 index 0000000..793f3f2 --- /dev/null +++ b/testing/gomodules/setup.py @@ -0,0 +1,15 @@ +from setuptools import Extension +from setuptools import setup + + +setup( + name='gomod', + ext_modules=[Extension('gomodules', ['reversemsg.go'])], + build_golang={ + 'root': 'github.com/asottile/setuptools-golang/testing/gomodules', + }, + # Would do this, but we're testing *our* implementation and this would + # install from pypi. We can rely on setuptools-golang being already + # installed under test. + # setup_requires=['setuptools-golang'], +) diff --git a/tests/setuptools_golang_test.py b/tests/setuptools_golang_test.py index eacf9a2..36f02c9 100644 --- a/tests/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -103,6 +103,15 @@ def test_integration_imports_gh(venv): assert out == '\x1b[0;31mohai\x1b[0m\n' +GOMOD = 'import gomodules; gomodules.reversemsg()' + + +def test_integration_gomodules(venv): + run(venv.pip, 'install', os.path.join('testing', 'gomodules')) + out = run_output(venv.python, '-c', GOMOD) + assert out == 'test example' + + def test_integration_notfound(venv): ret = run( venv.pip, 'install', os.path.join('testing', 'notfound'), From bcebf81f2bd99fecd75cc0a986f08d70e84bdfae Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 23 Sep 2020 09:02:01 -0700 Subject: [PATCH 061/225] v2.2.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 3073f4a..edb257a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 2.1.1 +version = 2.2.0 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From e9408f475e0c374bba7e9a6ea1f2f064c9053309 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 5 Oct 2020 12:57:54 -0700 Subject: [PATCH 062/225] change default build version to python3.9 --- setuptools_golang.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index 8dddd47..0f4fb96 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -206,7 +206,7 @@ def build_manylinux_wheels( help='Override golang version (default %(default)s)', ) parser.add_argument( - '--pythons', default='cp36-cp36m,cp37-cp37m,cp38-cp38', + '--pythons', default='cp36-cp36m,cp37-cp37m,cp38-cp38,cp39-cp39', help='Override pythons to build (default %(default)s)', ) args = parser.parse_args(argv) From 96a4c1777d890bcec978a8ecc700d5579b656599 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 5 Oct 2020 14:28:51 -0700 Subject: [PATCH 063/225] v2.3.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index edb257a..39e05ef 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 2.2.0 +version = 2.3.0 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From da326df858e63b1535af5e34ef64ec3960eb13a5 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 7 Nov 2020 12:32:44 -0800 Subject: [PATCH 064/225] Use pre-commit.ci Committed via https://github.com/asottile/all-repos --- README.md | 1 + azure-pipelines.yml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25f0965..658abf5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Build Status](https://dev.azure.com/asottile/asottile/_apis/build/status/asottile.setuptools-golang?branchName=master)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=52&branchName=master) [![Build status](https://ci.appveyor.com/api/projects/status/j4i2pc4o7pby3wdn/branch/master?svg=true)](https://ci.appveyor.com/project/asottile/setuptools-golang/branch/master) [![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/asottile/asottile/52/master.svg)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=52&branchName=master) +[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/setuptools-golang/master.svg)](https://results.pre-commit.ci/latest/github/asottile/setuptools-golang/master) setuptools-golang ================= diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 13194d0..82e556b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,7 +13,6 @@ resources: ref: refs/tags/v1.0.1 jobs: -- template: job--pre-commit.yml@asottile - template: job--python-tox.yml@asottile parameters: toxenvs: [py38] From be4947138718b8a873d9edb731e5d4df9ca402b9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2020 17:16:37 +0000 Subject: [PATCH 065/225] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e6c525d..c1ea607 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.5.0 + rev: v3.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -9,20 +9,20 @@ repos: - id: debug-statements - id: requirements-txt-fixer - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.0 + rev: 3.8.4 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.5.2 + rev: v1.5.4 hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports - rev: v2.3.0 + rev: v2.3.6 hooks: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.4.1 + rev: v2.7.4 hooks: - id: pyupgrade args: [--py36-plus] @@ -32,11 +32,11 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.9.0 + rev: v1.15.1 hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.770 + rev: v0.790 hooks: - id: mypy exclude: ^testing/ From e987730e5f99dd12f2e568203f2f7565ce27b836 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2020 17:22:01 +0000 Subject: [PATCH 066/225] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index 39e05ef..9e52df9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,6 +16,7 @@ classifiers = Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy From 783a5648b198eb978245107bad332960c811377f Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 19 Nov 2020 17:01:45 -0800 Subject: [PATCH 067/225] Add link to GitHub Sponsors at the time of writing I am currently unemployed. I'd love to make open source a full time career. if you or your company is deriving value from this free software, please consider [sponsoring]. [sponsoring]: https://github.com/sponsors/asottile Committed via https://github.com/asottile/all-repos --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..eb54a96 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: asottile From d5f6f5ad1f76edf8b193ee76be90669aa1bb81b1 Mon Sep 17 00:00:00 2001 From: Darragh Bailey Date: Tue, 22 Sep 2020 17:35:51 +0100 Subject: [PATCH 068/225] Allow user override of GOPATH Repeat building for developers can benefit from being able to shortcut full executions through cache reuse. Allow user to override the GOPATH used by specifying a module specific environment variable. This can allow a user to reuse a pre-populated golang module and build cache for faster compiles when developing. Note it requires a valid gomodule package, therefore re-using the gomodules test to validate that the GOPATH is modified. Local testing indicates that for a module in a custom project the install time could be reduced from 35 seconds to 9 seconds. While not perfect, it is still useful for local development environments, especially if more modules are used. --- README.md | 11 +++++++++++ setuptools_golang.py | 3 ++- tests/setuptools_golang_test.py | 16 ++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 658abf5..2873fc2 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,17 @@ duplicate symbol _PyDockerfile_GoParseError in: Make sure to mark global variables defined in C as `extern`. [Here's an example PR](https://github.com/asottile/dockerfile/pull/8) +### repeated rebuilds can be slow + +setuptools-golang attempts to make builds more repeatable by using a separate +`GOPATH` -- if you'd like to reuse a GOPATH you can set the +`SETUPTOOLS_GOLANG_GOPATH` environment variable: + +```console +$ SETUPTOOLS_GOLANG_GOPATH=~/go pip install . +... +``` + ## Building manylinux wheels `setuptools-golang` also provides a tool for building diff --git a/setuptools_golang.py b/setuptools_golang.py index 0f4fb96..849de1e 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -149,7 +149,8 @@ def build_extension(self: _build_ext, ext: Extension) -> None: shutil.copytree('.', root_path, symlinks=True) pkg_path = os.path.join(root_path, main_dir) - env = {'GOPATH': tempdir} + gopath = os.environ.get('SETUPTOOLS_GOLANG_GOPATH', tempdir) + env = {'GOPATH': gopath} cmd_get = ('go', 'get', '-d') _check_call(cmd_get, cwd=pkg_path, env=env) diff --git a/tests/setuptools_golang_test.py b/tests/setuptools_golang_test.py index 36f02c9..a671943 100644 --- a/tests/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -1,5 +1,6 @@ import collections import os +import shlex import subprocess import sys @@ -145,6 +146,21 @@ def test_integration_internal_imports(venv): assert out == 'ohai, Anthony\n' +def test_integration_user_gopath(venv, tmpdir): + testdir = os.path.join('testing', 'gomodules') + + gopath = str(tmpdir.join('gopath')) + env = {**os.environ, 'SETUPTOOLS_GOLANG_GOPATH': gopath} + ret = run( + venv.pip, 'install', '-v', testdir, + env=env, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + ) + + assert f"$ GOPATH={shlex.quote(gopath)} go get -d" in ret.out + + def test_integration_defines(venv): run(venv.pip, 'install', os.path.join('testing', 'defines')) out = run_output(venv.python, '-c', SUM.format('sum')) From 7b5e6cb66dd6bb17f8d24a2e0b963d7bc892dfe4 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 7 Dec 2020 13:45:39 -0800 Subject: [PATCH 069/225] v2.4.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 9e52df9..cd20c04 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 2.3.0 +version = 2.4.0 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From 45202b3ac2a9857b002786d1c21398af0e83c138 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Dec 2020 16:54:23 +0000 Subject: [PATCH 070/225] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c1ea607..9558214 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.3.0 + rev: v3.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -32,7 +32,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.15.1 + rev: v1.16.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy From dd1bb76d680d774ea84df70f3b0293e68d9b18a6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Jan 2021 16:56:25 +0000 Subject: [PATCH 071/225] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9558214..ffd5e7a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/asottile/add-trailing-comma - rev: v2.0.1 + rev: v2.0.2 hooks: - id: add-trailing-comma args: [--py36-plus] From 40a8e7cd3455b780b872828030f655bb6411ad4a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Jan 2021 16:51:05 +0000 Subject: [PATCH 072/225] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ffd5e7a..06797d6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/asottile/add-trailing-comma - rev: v2.0.2 + rev: v2.1.0 hooks: - id: add-trailing-comma args: [--py36-plus] @@ -36,7 +36,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.790 + rev: v0.800 hooks: - id: mypy exclude: ^testing/ From 8155b03e1827fd0c1b4e7dca87c24232d15087df Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Feb 2021 16:58:42 +0000 Subject: [PATCH 073/225] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 06797d6..6d8d497 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.7.4 + rev: v2.9.0 hooks: - id: pyupgrade args: [--py36-plus] From d4a1c3fb296642e6ed02ac2a0c84a2ea2008d211 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Feb 2021 17:00:29 +0000 Subject: [PATCH 074/225] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6d8d497..80681b5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,12 +17,12 @@ repos: hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports - rev: v2.3.6 + rev: v2.4.0 hooks: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.9.0 + rev: v2.10.0 hooks: - id: pyupgrade args: [--py36-plus] From 575e2af1eff43edf0f797aa5108c68402dbb68b9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 22 Feb 2021 17:13:24 +0000 Subject: [PATCH 075/225] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 80681b5..36778ad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.800 + rev: v0.812 hooks: - id: mypy exclude: ^testing/ From 07d29d29cc4a39e73dcc5eddc673f77b6e8750b2 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 8 Mar 2021 19:29:26 -0800 Subject: [PATCH 076/225] clean up PY_MAJOR_VERSION usage Committed via https://github.com/asottile/all-repos --- testing/defines/sum.c | 6 ------ testing/gomodules/reversemsg_support.go | 6 ------ testing/imports_gh/red.c | 14 +------------- testing/internal_imports/hello_lib/hello_lib.c | 14 +------------- testing/multidir/dir2/sum_support.go | 6 ------ testing/project_with_c/project_with_c.c | 6 ------ testing/project_with_c/project_with_c_sum/sum.c | 6 ------ testing/sum/sum.c | 6 ------ testing/sum_pure_go/sum_support.go | 6 ------ testing/sum_sub_package/sum_sub_package/sum.c | 6 ------ 10 files changed, 2 insertions(+), 74 deletions(-) diff --git a/testing/defines/sum.c b/testing/defines/sum.c index 1483c43..ec311ec 100644 --- a/testing/defines/sum.c +++ b/testing/defines/sum.c @@ -16,7 +16,6 @@ static struct PyMethodDef methods[] = { }; #endif -#if PY_MAJOR_VERSION >= 3 static struct PyModuleDef module = { PyModuleDef_HEAD_INIT, "sum", @@ -28,8 +27,3 @@ static struct PyModuleDef module = { PyMODINIT_FUNC PyInit_sum(void) { return PyModule_Create(&module); } -#else -PyMODINIT_FUNC initsum(void) { - Py_InitModule3("sum", methods, NULL); -} -#endif diff --git a/testing/gomodules/reversemsg_support.go b/testing/gomodules/reversemsg_support.go index 377fd7d..b901d17 100644 --- a/testing/gomodules/reversemsg_support.go +++ b/testing/gomodules/reversemsg_support.go @@ -9,7 +9,6 @@ package main // {NULL, NULL} // }; // -// #if PY_MAJOR_VERSION >= 3 // static struct PyModuleDef module = { // PyModuleDef_HEAD_INIT, // "gomodules", @@ -21,9 +20,4 @@ package main // PyMODINIT_FUNC PyInit_gomodules(void) { // return PyModule_Create(&module); // } -// #else -// PyMODINIT_FUNC initgomodules(void) { -// Py_InitModule3("gomodules", methods, NULL); -// } -// #endif import "C" diff --git a/testing/imports_gh/red.c b/testing/imports_gh/red.c index 7660ed9..59fa186 100644 --- a/testing/imports_gh/red.c +++ b/testing/imports_gh/red.c @@ -1,11 +1,5 @@ #include -#if PY_MAJOR_VERSION >= 3 -#define PyRed_Bytes_AS_STRING PyBytes_AS_STRING -#else -#define PyRed_Bytes_AS_STRING PyString_AS_STRING -#endif - /* Will come from go */ PyObject* red(PyObject*); @@ -20,7 +14,7 @@ void PyRed_DECREF(PyObject* obj) { } const char* PyRed_Bytes_AsString(PyObject* s) { - return PyRed_Bytes_AS_STRING(s); + return PyBytes_AS_STRING(s); } static struct PyMethodDef methods[] = { @@ -28,7 +22,6 @@ static struct PyMethodDef methods[] = { {NULL, NULL} }; -#if PY_MAJOR_VERSION >= 3 static struct PyModuleDef module = { PyModuleDef_HEAD_INIT, "red", @@ -40,8 +33,3 @@ static struct PyModuleDef module = { PyMODINIT_FUNC PyInit_red(void) { return PyModule_Create(&module); } -#else -PyMODINIT_FUNC initred(void) { - Py_InitModule3("red", methods, NULL); -} -#endif diff --git a/testing/internal_imports/hello_lib/hello_lib.c b/testing/internal_imports/hello_lib/hello_lib.c index 45c9e4f..d65e23c 100644 --- a/testing/internal_imports/hello_lib/hello_lib.c +++ b/testing/internal_imports/hello_lib/hello_lib.c @@ -1,11 +1,5 @@ #include -#if PY_MAJOR_VERSION >= 3 -#define PyHelloLib_Bytes_AS_STRING PyBytes_AS_STRING -#else -#define PyHelloLib_Bytes_AS_STRING PyString_AS_STRING -#endif - /* Will come from go */ PyObject* ohai(PyObject*); @@ -20,7 +14,7 @@ void PyHelloLib_DECREF(PyObject* obj) { } const char* PyHelloLib_Bytes_AsString(PyObject* s) { - return PyHelloLib_Bytes_AS_STRING(s); + return PyBytes_AS_STRING(s); } static struct PyMethodDef methods[] = { @@ -28,7 +22,6 @@ static struct PyMethodDef methods[] = { {NULL, NULL} }; -#if PY_MAJOR_VERSION >= 3 static struct PyModuleDef module = { PyModuleDef_HEAD_INIT, "hello_lib", @@ -40,8 +33,3 @@ static struct PyModuleDef module = { PyMODINIT_FUNC PyInit_hello_lib(void) { return PyModule_Create(&module); } -#else -PyMODINIT_FUNC inithello_lib(void) { - Py_InitModule3("hello_lib", methods, NULL); -} -#endif diff --git a/testing/multidir/dir2/sum_support.go b/testing/multidir/dir2/sum_support.go index 085d174..4be980c 100644 --- a/testing/multidir/dir2/sum_support.go +++ b/testing/multidir/dir2/sum_support.go @@ -13,7 +13,6 @@ package main // {NULL, NULL} // }; // -// #if PY_MAJOR_VERSION >= 3 // static struct PyModuleDef module = { // PyModuleDef_HEAD_INIT, // "sum_pure_go", @@ -25,9 +24,4 @@ package main // PyMODINIT_FUNC PyInit_sum_pure_go(void) { // return PyModule_Create(&module); // } -// #else -// PyMODINIT_FUNC initsum_pure_go(void) { -// Py_InitModule3("sum_pure_go", methods, NULL); -// } -// #endif import "C" diff --git a/testing/project_with_c/project_with_c.c b/testing/project_with_c/project_with_c.c index 29d4d30..e45480c 100644 --- a/testing/project_with_c/project_with_c.c +++ b/testing/project_with_c/project_with_c.c @@ -9,7 +9,6 @@ static struct PyMethodDef methods[] = { {NULL, NULL} }; -#if PY_MAJOR_VERSION >= 3 static struct PyModuleDef module = { PyModuleDef_HEAD_INIT, "project_with_c", @@ -21,8 +20,3 @@ static struct PyModuleDef module = { PyMODINIT_FUNC PyInit_project_with_c(void) { return PyModule_Create(&module); } -#else -PyMODINIT_FUNC initproject_with_c(void) { - Py_InitModule3("project_with_c", methods, NULL); -} -#endif diff --git a/testing/project_with_c/project_with_c_sum/sum.c b/testing/project_with_c/project_with_c_sum/sum.c index f7158c5..3d2a63c 100644 --- a/testing/project_with_c/project_with_c_sum/sum.c +++ b/testing/project_with_c/project_with_c_sum/sum.c @@ -13,7 +13,6 @@ static struct PyMethodDef methods[] = { {NULL, NULL} }; -#if PY_MAJOR_VERSION >= 3 static struct PyModuleDef module = { PyModuleDef_HEAD_INIT, "project_with_c_sum.sum", @@ -25,8 +24,3 @@ static struct PyModuleDef module = { PyMODINIT_FUNC PyInit_sum(void) { return PyModule_Create(&module); } -#else -PyMODINIT_FUNC initsum(void) { - Py_InitModule3("project_with_c_sum.sum", methods, NULL); -} -#endif diff --git a/testing/sum/sum.c b/testing/sum/sum.c index 6df94ba..56cce5e 100644 --- a/testing/sum/sum.c +++ b/testing/sum/sum.c @@ -13,7 +13,6 @@ static struct PyMethodDef methods[] = { {NULL, NULL} }; -#if PY_MAJOR_VERSION >= 3 static struct PyModuleDef module = { PyModuleDef_HEAD_INIT, "sum", @@ -25,8 +24,3 @@ static struct PyModuleDef module = { PyMODINIT_FUNC PyInit_sum(void) { return PyModule_Create(&module); } -#else -PyMODINIT_FUNC initsum(void) { - Py_InitModule3("sum", methods, NULL); -} -#endif diff --git a/testing/sum_pure_go/sum_support.go b/testing/sum_pure_go/sum_support.go index 085d174..4be980c 100644 --- a/testing/sum_pure_go/sum_support.go +++ b/testing/sum_pure_go/sum_support.go @@ -13,7 +13,6 @@ package main // {NULL, NULL} // }; // -// #if PY_MAJOR_VERSION >= 3 // static struct PyModuleDef module = { // PyModuleDef_HEAD_INIT, // "sum_pure_go", @@ -25,9 +24,4 @@ package main // PyMODINIT_FUNC PyInit_sum_pure_go(void) { // return PyModule_Create(&module); // } -// #else -// PyMODINIT_FUNC initsum_pure_go(void) { -// Py_InitModule3("sum_pure_go", methods, NULL); -// } -// #endif import "C" diff --git a/testing/sum_sub_package/sum_sub_package/sum.c b/testing/sum_sub_package/sum_sub_package/sum.c index c1e4ca6..e47af2b 100644 --- a/testing/sum_sub_package/sum_sub_package/sum.c +++ b/testing/sum_sub_package/sum_sub_package/sum.c @@ -13,7 +13,6 @@ static struct PyMethodDef methods[] = { {NULL, NULL} }; -#if PY_MAJOR_VERSION >= 3 static struct PyModuleDef module = { PyModuleDef_HEAD_INIT, "sum_sub_package.sum", @@ -25,8 +24,3 @@ static struct PyModuleDef module = { PyMODINIT_FUNC PyInit_sum(void) { return PyModule_Create(&module); } -#else -PyMODINIT_FUNC initsum(void) { - Py_InitModule3("sum_sub_package.sum", methods, NULL); -} -#endif From 6ac6b76f085fde973d772c362272bf3a44f51e65 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Mar 2021 17:13:24 +0000 Subject: [PATCH 077/225] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 36778ad..edc9caf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,11 +9,11 @@ repos: - id: debug-statements - id: requirements-txt-fixer - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.4 + rev: 3.9.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.5.4 + rev: v1.5.5 hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports @@ -32,7 +32,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.16.0 + rev: v1.17.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy From e98bbc2b1a96821b19dd9210e871fe069ca814c5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 22 Mar 2021 17:16:43 +0000 Subject: [PATCH 078/225] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index edc9caf..41eceda 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.5.5 + rev: v1.5.6 hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.10.0 + rev: v2.11.0 hooks: - id: pyupgrade args: [--py36-plus] From b8306e102372511da40981ae1b1f1308d25c9b26 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Apr 2021 17:22:39 +0000 Subject: [PATCH 079/225] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 41eceda..ebc35f8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: - id: check-yaml - id: debug-statements - id: requirements-txt-fixer -- repo: https://gitlab.com/pycqa/flake8 +- repo: https://github.com/PyCQA/flake8 rev: 3.9.0 hooks: - id: flake8 From 27ce0f755bb481a6f8f28b7ee12f095314e4e95a Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 8 Apr 2021 19:21:52 -0700 Subject: [PATCH 080/225] Update azure-pipelines template repositories Committed via https://github.com/asottile/all-repos --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 82e556b..83d2ee9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,7 +10,7 @@ resources: type: github endpoint: github name: asottile/azure-pipeline-templates - ref: refs/tags/v1.0.1 + ref: refs/tags/v2.1.0 jobs: - template: job--python-tox.yml@asottile From 585ed35242eb945bdfb645f83d48ab8827ae1c67 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 12 Apr 2021 17:23:53 +0000 Subject: [PATCH 081/225] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ebc35f8..e1fba4f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.11.0 + rev: v2.12.0 hooks: - id: pyupgrade args: [--py36-plus] From 15fc87548bb3d2fc4f7658a057cedfe287b31f83 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Apr 2021 17:22:55 +0000 Subject: [PATCH 082/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 3.9.0 → 3.9.1](https://github.com/PyCQA/flake8/compare/3.9.0...3.9.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e1fba4f..6bc7371 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: debug-statements - id: requirements-txt-fixer - repo: https://github.com/PyCQA/flake8 - rev: 3.9.0 + rev: 3.9.1 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-autopep8 From c6914542361aeb04bdfeb2cc311a064e5c167946 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 26 Apr 2021 17:37:26 +0000 Subject: [PATCH 083/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v2.4.0 → v2.5.0](https://github.com/asottile/reorder_python_imports/compare/v2.4.0...v2.5.0) - [github.com/asottile/pyupgrade: v2.12.0 → v2.13.0](https://github.com/asottile/pyupgrade/compare/v2.12.0...v2.13.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6bc7371..19bf1c6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,12 +17,12 @@ repos: hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports - rev: v2.4.0 + rev: v2.5.0 hooks: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.12.0 + rev: v2.13.0 hooks: - id: pyupgrade args: [--py36-plus] From 0226449ce63f70dc6a53a9544b80c341e1dc539e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 May 2021 17:44:01 +0000 Subject: [PATCH 084/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-autopep8: v1.5.6 → v1.5.7](https://github.com/pre-commit/mirrors-autopep8/compare/v1.5.6...v1.5.7) - [github.com/asottile/pyupgrade: v2.13.0 → v2.14.0](https://github.com/asottile/pyupgrade/compare/v2.13.0...v2.14.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 19bf1c6..abd7f92 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.5.6 + rev: v1.5.7 hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.13.0 + rev: v2.14.0 hooks: - id: pyupgrade args: [--py36-plus] From 948bf485048d8eec77986a17db447edeaa115aaa Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 14 May 2021 19:04:43 -0700 Subject: [PATCH 085/225] Use more inclusive language Committed via https://github.com/asottile/all-repos --- setuptools_golang.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index 849de1e..e52758a 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -74,7 +74,7 @@ def _get_cflags( def _get_ldflags() -> str: - """Determine the correct link flags. This attempts dummy compiles similar + """Determine the correct link flags. This attempts compiles similar to how autotools does feature detection. """ # windows gcc does not support linking with unresolved symbols From 37293f1ced88775645a47e4fa0ff0cde697b2617 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 May 2021 17:47:30 +0000 Subject: [PATCH 086/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v3.4.0 → v4.0.1](https://github.com/pre-commit/pre-commit-hooks/compare/v3.4.0...v4.0.1) - [github.com/PyCQA/flake8: 3.9.1 → 3.9.2](https://github.com/PyCQA/flake8/compare/3.9.1...3.9.2) - [github.com/asottile/pyupgrade: v2.14.0 → v2.16.0](https://github.com/asottile/pyupgrade/compare/v2.14.0...v2.16.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index abd7f92..69dc63a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v4.0.1 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -9,7 +9,7 @@ repos: - id: debug-statements - id: requirements-txt-fixer - repo: https://github.com/PyCQA/flake8 - rev: 3.9.1 + rev: 3.9.2 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-autopep8 @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.14.0 + rev: v2.16.0 hooks: - id: pyupgrade args: [--py36-plus] From be7f5772ffa60fcc1604e1a30ec2dc32a9427f58 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 May 2021 17:39:40 +0000 Subject: [PATCH 087/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.16.0 → v2.18.2](https://github.com/asottile/pyupgrade/compare/v2.16.0...v2.18.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 69dc63a..a293073 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.16.0 + rev: v2.18.2 hooks: - id: pyupgrade args: [--py36-plus] From 8070dc6e4c67696d2ae8c70a57934c20650a9939 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 31 May 2021 17:50:24 +0000 Subject: [PATCH 088/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.18.2 → v2.19.0](https://github.com/asottile/pyupgrade/compare/v2.18.2...v2.19.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a293073..1fee968 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.18.2 + rev: v2.19.0 hooks: - id: pyupgrade args: [--py36-plus] From a7bc5d264ffd179192a8bdf59c83b8f4ad44c096 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 8 Jun 2021 02:08:49 +0000 Subject: [PATCH 089/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.19.0 → v2.19.1](https://github.com/asottile/pyupgrade/compare/v2.19.0...v2.19.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1fee968..91c6696 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.19.0 + rev: v2.19.1 hooks: - id: pyupgrade args: [--py36-plus] From d5981fd631feb1f3404420a20417109fdf0e0e9f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 14 Jun 2021 17:59:44 +0000 Subject: [PATCH 090/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.19.1 → v2.19.4](https://github.com/asottile/pyupgrade/compare/v2.19.1...v2.19.4) - [github.com/pre-commit/mirrors-mypy: v0.812 → v0.902](https://github.com/pre-commit/mirrors-mypy/compare/v0.812...v0.902) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91c6696..3fda8a2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.19.1 + rev: v2.19.4 hooks: - id: pyupgrade args: [--py36-plus] @@ -36,7 +36,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.812 + rev: v0.902 hooks: - id: mypy exclude: ^testing/ From 811147e9d5373fbc1293f9e4fd304c5404e36e58 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 21 Jun 2021 19:14:23 -0700 Subject: [PATCH 091/225] stricter mypy settings Committed via https://github.com/asottile/all-repos --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.cfg b/setup.cfg index cd20c04..812f818 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,6 +45,8 @@ disallow_any_generics = true disallow_incomplete_defs = true disallow_untyped_defs = true no_implicit_optional = true +warn_redundant_casts = true +warn_unused_ignores = true [mypy-testing.*] disallow_untyped_defs = false From 5d9e8c267a43a617e9f481068958638c40b6b91c Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 21 Jun 2021 19:28:06 -0700 Subject: [PATCH 092/225] remove unused type ignores --- setuptools_golang.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index e52758a..aabcfb0 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -58,8 +58,7 @@ def _get_cflags( compiler: CCompiler, macros: Sequence[Tuple[str, Optional[str]]], ) -> str: - # https://github.com/python/typeshed/pull/3741 - args = [f'-I{p}' for p in compiler.include_dirs] # type: ignore + args = [f'-I{p}' for p in compiler.include_dirs] for macro_name, macro_value in macros: if macro_value is None: args.append(f'-D{macro_name}') @@ -180,9 +179,8 @@ def set_build_ext( value: Dict[str, str], ) -> None: root = value['root'] - # https://github.com/python/typeshed/pull/3742 - base = dist.cmdclass.get('build_ext', _build_ext) # type: ignore - dist.cmdclass['build_ext'] = _get_build_ext_cls(base, root) # type: ignore + base = dist.cmdclass.get('build_ext', _build_ext) + dist.cmdclass['build_ext'] = _get_build_ext_cls(base, root) GOLANG = 'https://storage.googleapis.com/golang/go{}.linux-amd64.tar.gz' From ec7a518f5d30ab64da2527d47a18bc7ae0bbab77 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Jun 2021 18:02:16 +0000 Subject: [PATCH 093/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.902 → v0.910](https://github.com/pre-commit/mirrors-mypy/compare/v0.902...v0.910) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3fda8a2..57fe197 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.902 + rev: v0.910 hooks: - id: mypy exclude: ^testing/ From 7590be8ef19b0b262a8f8e75cb036354cabb8a1e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Jul 2021 22:29:41 +0000 Subject: [PATCH 094/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.19.4 → v2.20.0](https://github.com/asottile/pyupgrade/compare/v2.19.4...v2.20.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 57fe197..b01b74d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.19.4 + rev: v2.20.0 hooks: - id: pyupgrade args: [--py36-plus] From f423cbfc41ab6695e3f92567373e4c0414a917cf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 12 Jul 2021 23:53:04 +0000 Subject: [PATCH 095/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.20.0 → v2.21.0](https://github.com/asottile/pyupgrade/compare/v2.20.0...v2.21.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b01b74d..5e75eca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.20.0 + rev: v2.21.0 hooks: - id: pyupgrade args: [--py36-plus] From 4431dcf63f4125dfbf95abb7bf19345115689963 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Jul 2021 22:35:44 +0000 Subject: [PATCH 096/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.21.0 → v2.21.2](https://github.com/asottile/pyupgrade/compare/v2.21.0...v2.21.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5e75eca..b35e895 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.21.0 + rev: v2.21.2 hooks: - id: pyupgrade args: [--py36-plus] From 431e09717fb74990647b5ce1b06ec3b8f93702e5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 26 Jul 2021 18:28:41 +0000 Subject: [PATCH 097/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v2.5.0 → v2.6.0](https://github.com/asottile/reorder_python_imports/compare/v2.5.0...v2.6.0) - [github.com/asottile/pyupgrade: v2.21.2 → v2.23.0](https://github.com/asottile/pyupgrade/compare/v2.21.2...v2.23.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b35e895..7ba961c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,12 +17,12 @@ repos: hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports - rev: v2.5.0 + rev: v2.6.0 hooks: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.21.2 + rev: v2.23.0 hooks: - id: pyupgrade args: [--py36-plus] From a88916055c45efaa5066481b8d4c35c195ed277b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Aug 2021 19:17:27 +0000 Subject: [PATCH 098/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.23.0 → v2.23.1](https://github.com/asottile/pyupgrade/compare/v2.23.0...v2.23.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7ba961c..f8428b3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.23.0 + rev: v2.23.1 hooks: - id: pyupgrade args: [--py36-plus] From 4597b9ce91ff05a1237e0f79095509781ef93f1b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 19:18:32 +0000 Subject: [PATCH 099/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.23.1 → v2.23.3](https://github.com/asottile/pyupgrade/compare/v2.23.1...v2.23.3) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f8428b3..0494731 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.23.1 + rev: v2.23.3 hooks: - id: pyupgrade args: [--py36-plus] From d2674b0242b7e1b06894fc77bb4406794be17bc0 Mon Sep 17 00:00:00 2001 From: corka149 Date: Wed, 18 Aug 2021 22:55:41 +0200 Subject: [PATCH 100/225] Added go.mod --- testing/dangling_symlink/go.mod | 3 +++ testing/defines/go.mod | 3 +++ testing/imports_gh/go.mod | 3 +++ testing/internal_imports/go.mod | 3 +++ testing/multidir/go.mod | 3 +++ testing/notfound/go.mod | 3 +++ testing/project_with_c/go.mod | 3 +++ testing/sum/go.mod | 3 +++ testing/sum_pure_go/go.mod | 3 +++ testing/sum_sub_package/go.mod | 3 +++ 10 files changed, 30 insertions(+) create mode 100644 testing/dangling_symlink/go.mod create mode 100644 testing/defines/go.mod create mode 100644 testing/imports_gh/go.mod create mode 100644 testing/internal_imports/go.mod create mode 100644 testing/multidir/go.mod create mode 100644 testing/notfound/go.mod create mode 100644 testing/project_with_c/go.mod create mode 100644 testing/sum/go.mod create mode 100644 testing/sum_pure_go/go.mod create mode 100644 testing/sum_sub_package/go.mod diff --git a/testing/dangling_symlink/go.mod b/testing/dangling_symlink/go.mod new file mode 100644 index 0000000..f647b9d --- /dev/null +++ b/testing/dangling_symlink/go.mod @@ -0,0 +1,3 @@ +module github.com/asottile/fake + +go 1.16 diff --git a/testing/defines/go.mod b/testing/defines/go.mod new file mode 100644 index 0000000..f647b9d --- /dev/null +++ b/testing/defines/go.mod @@ -0,0 +1,3 @@ +module github.com/asottile/fake + +go 1.16 diff --git a/testing/imports_gh/go.mod b/testing/imports_gh/go.mod new file mode 100644 index 0000000..f647b9d --- /dev/null +++ b/testing/imports_gh/go.mod @@ -0,0 +1,3 @@ +module github.com/asottile/fake + +go 1.16 diff --git a/testing/internal_imports/go.mod b/testing/internal_imports/go.mod new file mode 100644 index 0000000..f647b9d --- /dev/null +++ b/testing/internal_imports/go.mod @@ -0,0 +1,3 @@ +module github.com/asottile/fake + +go 1.16 diff --git a/testing/multidir/go.mod b/testing/multidir/go.mod new file mode 100644 index 0000000..f647b9d --- /dev/null +++ b/testing/multidir/go.mod @@ -0,0 +1,3 @@ +module github.com/asottile/fake + +go 1.16 diff --git a/testing/notfound/go.mod b/testing/notfound/go.mod new file mode 100644 index 0000000..f647b9d --- /dev/null +++ b/testing/notfound/go.mod @@ -0,0 +1,3 @@ +module github.com/asottile/fake + +go 1.16 diff --git a/testing/project_with_c/go.mod b/testing/project_with_c/go.mod new file mode 100644 index 0000000..f647b9d --- /dev/null +++ b/testing/project_with_c/go.mod @@ -0,0 +1,3 @@ +module github.com/asottile/fake + +go 1.16 diff --git a/testing/sum/go.mod b/testing/sum/go.mod new file mode 100644 index 0000000..f647b9d --- /dev/null +++ b/testing/sum/go.mod @@ -0,0 +1,3 @@ +module github.com/asottile/fake + +go 1.16 diff --git a/testing/sum_pure_go/go.mod b/testing/sum_pure_go/go.mod new file mode 100644 index 0000000..f647b9d --- /dev/null +++ b/testing/sum_pure_go/go.mod @@ -0,0 +1,3 @@ +module github.com/asottile/fake + +go 1.16 diff --git a/testing/sum_sub_package/go.mod b/testing/sum_sub_package/go.mod new file mode 100644 index 0000000..f647b9d --- /dev/null +++ b/testing/sum_sub_package/go.mod @@ -0,0 +1,3 @@ +module github.com/asottile/fake + +go 1.16 From 2b43471cfc66704ba75bc86d66f6cd0941757c30 Mon Sep 17 00:00:00 2001 From: corka149 Date: Wed, 18 Aug 2021 21:21:41 +0200 Subject: [PATCH 101/225] Added striping debugging information and symbols --- README.md | 5 +++++ setuptools_golang.py | 24 +++++++++++++++++------- testing/sum_sub_package/setup.py | 2 +- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2873fc2..2ac0ef9 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,11 @@ Add `setuptools-golang` to the `setup_requires` in your setup.py and `build_golang={'root': ...}`. `root` refers to the root go import path of your project. +By default, `setuptools-golang` will strip all binaries. This can be disabled +by adding `'strip': False` to `build_golang`. This will increase the size of +the extension, but the binaries contain debugging information and symbols. + + An extension must be a single file in the `main` go package (though the entire `main` package will be built into the extension). That package may import other code. diff --git a/setuptools_golang.py b/setuptools_golang.py index aabcfb0..0aafeea 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -113,6 +113,7 @@ def _check_call(cmd: Tuple[str, ...], cwd: str, env: Dict[str, str]) -> None: def _get_build_extension_method( base: Type[_build_ext], root: str, + strip: bool, ) -> Callable[[_build_ext, Extension], None]: def build_extension(self: _build_ext, ext: Extension) -> None: # If there are no .go files then the parent should handle this @@ -129,7 +130,7 @@ def build_extension(self: _build_ext, ext: Extension) -> None: raise OSError( f'Error building extension `{ext.name}`: ' f'sources must be a single file in the `main` package.\n' - f'Recieved: {ext.sources!r}', + f'Received: {ext.sources!r}', ) main_file, = ext.sources @@ -159,28 +160,37 @@ def build_extension(self: _build_ext, ext: Extension) -> None: ), 'CGO_LDFLAGS': _get_ldflags(), }) - cmd_build = ( + + cmd_build: Tuple[str, ...] = ( 'go', 'build', '-buildmode=c-shared', '-o', os.path.abspath(self.get_ext_fullpath(ext.name)), ) + # "-s" omits the symbol table and debug information + # "-w" omits DWARF debugging information + if strip: + cmd_build = (*cmd_build, '-ldflags=-s -w') + _check_call(cmd_build, cwd=pkg_path, env=env) return build_extension -def _get_build_ext_cls(base: Type[_build_ext], root: str) -> Type[_build_ext]: - attrs = {'build_extension': _get_build_extension_method(base, root)} +def _get_build_ext_cls( + base: Type[_build_ext], + root: str, + strip: bool = True, +) -> Type[_build_ext]: + attrs = {'build_extension': _get_build_extension_method(base, root, strip)} return type('build_ext', (base,), attrs) def set_build_ext( dist: Distribution, attr: str, - value: Dict[str, str], + value: Dict[str, Any], ) -> None: - root = value['root'] base = dist.cmdclass.get('build_ext', _build_ext) - dist.cmdclass['build_ext'] = _get_build_ext_cls(base, root) + dist.cmdclass['build_ext'] = _get_build_ext_cls(base, **value) GOLANG = 'https://storage.googleapis.com/golang/go{}.linux-amd64.tar.gz' diff --git a/testing/sum_sub_package/setup.py b/testing/sum_sub_package/setup.py index 42c77a2..47dfbef 100644 --- a/testing/sum_sub_package/setup.py +++ b/testing/sum_sub_package/setup.py @@ -7,7 +7,7 @@ name='sum_sub_package', ext_modules=[Extension('sum_sub_package.sum', ['sum_sub_package/sum.go'])], packages=find_packages(), - build_golang={'root': 'github.com/asottile/fake'}, + build_golang={'root': 'github.com/asottile/fake', 'strip': False}, # Would do this, but we're testing *our* implementation and this would # install from pypi. We can rely on setuptools-golang being already # installed under test. From fbceba6136073e57d757c73aafac0db6e03504a4 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 19 Aug 2021 19:56:09 -0400 Subject: [PATCH 102/225] v2.5.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 812f818..2a02114 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 2.4.0 +version = 2.5.0 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From 66b9caa0295d6ffd8bedbf24c18ca98ab593f62a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 19:23:34 +0000 Subject: [PATCH 103/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.23.3 → v2.24.0](https://github.com/asottile/pyupgrade/compare/v2.23.3...v2.24.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0494731..6ed7331 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.23.3 + rev: v2.24.0 hooks: - id: pyupgrade args: [--py36-plus] From 4321e09fd3b29c91fc1d8db9a071e51ab0cf48f3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Aug 2021 20:00:30 +0000 Subject: [PATCH 104/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.24.0 → v2.25.0](https://github.com/asottile/pyupgrade/compare/v2.24.0...v2.25.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ed7331..f7b4285 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.24.0 + rev: v2.25.0 hooks: - id: pyupgrade args: [--py36-plus] From c47486056d664c36a98f14dd7a847c2ddc869b08 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 12 Sep 2021 16:55:37 -0400 Subject: [PATCH 105/225] update tested go versions --- README.md | 2 +- azure-pipelines.yml | 8 ++++---- setuptools_golang.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2ac0ef9..41e914b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ A setuptools extension for building cpython extensions written in golang. ## Requirements -This requires golang >= 1.5. It is currently tested against 1.10 and 1.11. +This requires golang >= 1.5. It is currently tested against 1.16 and 1.17. This requires python >= 3.6. It is currently tested against python3 and pypy3. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 83d2ee9..b64b42e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,17 +17,17 @@ jobs: parameters: toxenvs: [py38] os: linux - name_postfix: _go_1_14 + name_postfix: _go_1_16 pre_test: - task: GoTool@0 inputs: - version: '1.14.8' + version: '1.16.8' - template: job--python-tox.yml@asottile parameters: toxenvs: [pypy3, py36, py37, py38] os: linux - name_postfix: _go_1_15 + name_postfix: _go_1_17 pre_test: - task: GoTool@0 inputs: - version: '1.15.1' + version: '1.17.1' diff --git a/setuptools_golang.py b/setuptools_golang.py index 0aafeea..3fd3aa3 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -211,7 +211,7 @@ def build_manylinux_wheels( ) -> int: # pragma: no cover parser = argparse.ArgumentParser() parser.add_argument( - '--golang', default='1.14.8', + '--golang', default='1.17.1', help='Override golang version (default %(default)s)', ) parser.add_argument( From 70eb493ad2f2a9858f7e621ccb8d4ebcda589fc4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 20:14:41 +0000 Subject: [PATCH 106/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.25.0 → v2.26.0](https://github.com/asottile/pyupgrade/compare/v2.25.0...v2.26.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f7b4285..03cef4c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.25.0 + rev: v2.26.0 hooks: - id: pyupgrade args: [--py36-plus] From abe537867f8be3a8d9a832640049f4aad8728afd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 20:16:03 +0000 Subject: [PATCH 107/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.26.0 → v2.28.0](https://github.com/asottile/pyupgrade/compare/v2.26.0...v2.28.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 03cef4c..f4d27ef 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.26.0 + rev: v2.28.0 hooks: - id: pyupgrade args: [--py36-plus] From 50ecc0b699c560143bf9e3f5fb6562570b330082 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 20:22:11 +0000 Subject: [PATCH 108/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.28.0 → v2.29.0](https://github.com/asottile/pyupgrade/compare/v2.28.0...v2.29.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f4d27ef..9566336 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.28.0 + rev: v2.29.0 hooks: - id: pyupgrade args: [--py36-plus] From 7f6cf9ea80dec9f7467af4b2fdfbdf4afb6ad9bc Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 4 Oct 2021 18:26:12 -0400 Subject: [PATCH 109/225] change --pythons default to only cp36 for abi3 --- setuptools_golang.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index 3fd3aa3..a30e0c9 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -215,7 +215,7 @@ def build_manylinux_wheels( help='Override golang version (default %(default)s)', ) parser.add_argument( - '--pythons', default='cp36-cp36m,cp37-cp37m,cp38-cp38,cp39-cp39', + '--pythons', default='cp36-cp36m', help='Override pythons to build (default %(default)s)', ) args = parser.parse_args(argv) From fc0766fc963d69e72a641851d6ab8c880594afe1 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 4 Oct 2021 19:20:50 -0400 Subject: [PATCH 110/225] v2.6.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 2a02114..4040bce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 2.5.0 +version = 2.6.0 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From 813545939ee9d05124bc4de45f99e785893ccad3 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 4 Oct 2021 19:21:52 -0400 Subject: [PATCH 111/225] v2.7.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 4040bce..9ca616e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 2.6.0 +version = 2.7.0 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From d0c4be8683b2a15f83a6005dc0f8ceaf699d2308 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Oct 2021 20:23:26 +0000 Subject: [PATCH 112/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 3.9.2 → 4.0.1](https://github.com/PyCQA/flake8/compare/3.9.2...4.0.1) - [github.com/asottile/setup-cfg-fmt: v1.17.0 → v1.18.0](https://github.com/asottile/setup-cfg-fmt/compare/v1.17.0...v1.18.0) - [github.com/pre-commit/mirrors-mypy: v0.910 → v0.910-1](https://github.com/pre-commit/mirrors-mypy/compare/v0.910...v0.910-1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9566336..81b587f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: debug-statements - id: requirements-txt-fixer - repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 + rev: 4.0.1 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-autopep8 @@ -32,11 +32,11 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.17.0 + rev: v1.18.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.910 + rev: v0.910-1 hooks: - id: mypy exclude: ^testing/ From 167f931ac42da55339efce6d41f92b264d324191 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Oct 2021 20:27:42 +0000 Subject: [PATCH 113/225] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index 9ca616e..f14c3de 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,6 +17,7 @@ classifiers = Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy From 958bbdfd24b4340607f8274c6ffbb9b0c74bca9d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Oct 2021 20:24:25 +0000 Subject: [PATCH 114/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/add-trailing-comma: v2.1.0 → v2.2.0](https://github.com/asottile/add-trailing-comma/compare/v2.1.0...v2.2.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 81b587f..cb97fdf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/asottile/add-trailing-comma - rev: v2.1.0 + rev: v2.2.0 hooks: - id: add-trailing-comma args: [--py36-plus] From d61dd8fc329b70bb69c934c5991f0f6695f1c7f6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Nov 2021 21:17:22 +0000 Subject: [PATCH 115/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/setup-cfg-fmt: v1.18.0 → v1.19.0](https://github.com/asottile/setup-cfg-fmt/compare/v1.18.0...v1.19.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cb97fdf..44b023b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.18.0 + rev: v1.19.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy From d752441dcb432b9019015a00a55d6e652162aee2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 22 Nov 2021 21:45:21 +0000 Subject: [PATCH 116/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.29.0 → v2.29.1](https://github.com/asottile/pyupgrade/compare/v2.29.0...v2.29.1) - [github.com/asottile/add-trailing-comma: v2.2.0 → v2.2.1](https://github.com/asottile/add-trailing-comma/compare/v2.2.0...v2.2.1) - [github.com/asottile/setup-cfg-fmt: v1.19.0 → v1.20.0](https://github.com/asottile/setup-cfg-fmt/compare/v1.19.0...v1.20.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 44b023b..bd04ce2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,17 +22,17 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.29.0 + rev: v2.29.1 hooks: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/asottile/add-trailing-comma - rev: v2.2.0 + rev: v2.2.1 hooks: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.19.0 + rev: v1.20.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy From 90d582d6a6c84cfee8a93cc97ab2fa869b93a836 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 23 Nov 2021 11:22:44 -0500 Subject: [PATCH 117/225] Use org-default .github/FUNDING.yml Committed via https://github.com/asottile/all-repos --- .github/FUNDING.yml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index eb54a96..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: asottile From a7867aa24bb21a323790911d42c182c695e10152 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 29 Nov 2021 20:36:16 -0500 Subject: [PATCH 118/225] improve coverage pragmas with covdefaults 2.1 Committed via https://github.com/asottile/all-repos --- setuptools_golang.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index a30e0c9..a3abdd9 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -77,7 +77,7 @@ def _get_ldflags() -> str: to how autotools does feature detection. """ # windows gcc does not support linking with unresolved symbols - if sys.platform == 'win32': # pragma: no cover (windows) + if sys.platform == 'win32': # pragma: win32 cover prefix = getattr(sys, 'real_prefix', sys.prefix) libs = os.path.join(prefix, 'libs') return '-L{} -lpython{}{}'.format(libs, *sys.version_info[:2]) From 2d818c71d36eee870276a67650aad8bd248caadd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Dec 2021 21:40:41 +0000 Subject: [PATCH 119/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.910-1 → v0.920](https://github.com/pre-commit/mirrors-mypy/compare/v0.910-1...v0.920) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd04ce2..7a97b22 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.910-1 + rev: v0.920 hooks: - id: mypy exclude: ^testing/ From 53a1fd296853c30d738260faf40b15e09e2e112a Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 20 Dec 2021 17:08:29 -0500 Subject: [PATCH 120/225] drop appveyor the build broke for some unknown external reason and it's not worth it --- README.md | 1 - appveyor.yml | 15 --------------- 2 files changed, 16 deletions(-) delete mode 100644 appveyor.yml diff --git a/README.md b/README.md index 41e914b..a673b76 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ [![Build Status](https://dev.azure.com/asottile/asottile/_apis/build/status/asottile.setuptools-golang?branchName=master)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=52&branchName=master) -[![Build status](https://ci.appveyor.com/api/projects/status/j4i2pc4o7pby3wdn/branch/master?svg=true)](https://ci.appveyor.com/project/asottile/setuptools-golang/branch/master) [![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/asottile/asottile/52/master.svg)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=52&branchName=master) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/setuptools-golang/master.svg)](https://results.pre-commit.ci/latest/github/asottile/setuptools-golang/master) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index b2a6e50..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,15 +0,0 @@ -environment: - matrix: - - PYTHON: 'C:\Python37' - -install: -- 'SET PATH=%PYTHON%;%PYTHON%\Scripts;C:\MinGW\bin;C:\go-x86\bin;%PATH%' -- 'SET GOROOT=C:\go-x86' -- 'pip install pytest' - -# Not a C# project -build: false - -test_script: pytest tests - -cache: '%LOCALAPPDATA%\pip\cache' From ed4e93f92d86534f243adf3f87b35a6fdf9efd80 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Dec 2021 22:22:11 +0000 Subject: [PATCH 121/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.0.1...v4.1.0) - [github.com/pre-commit/mirrors-mypy: v0.920 → v0.930](https://github.com/pre-commit/mirrors-mypy/compare/v0.920...v0.930) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7a97b22..8cf5157 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.1.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -36,7 +36,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.920 + rev: v0.930 hooks: - id: mypy exclude: ^testing/ From 3d3466b9cc77a624f0a20aa0ba27c6f945f7e802 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Jan 2022 22:09:21 +0000 Subject: [PATCH 122/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-autopep8: v1.5.7 → v1.6.0](https://github.com/pre-commit/mirrors-autopep8/compare/v1.5.7...v1.6.0) - [github.com/asottile/pyupgrade: v2.29.1 → v2.31.0](https://github.com/asottile/pyupgrade/compare/v2.29.1...v2.31.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8cf5157..33a9c06 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.5.7 + rev: v1.6.0 hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports @@ -22,7 +22,7 @@ repos: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.29.1 + rev: v2.31.0 hooks: - id: pyupgrade args: [--py36-plus] From b769b19a6bbbe7934f37b85295573a161ad13fef Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Jan 2022 22:26:49 +0000 Subject: [PATCH 123/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.930 → v0.931](https://github.com/pre-commit/mirrors-mypy/compare/v0.930...v0.931) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 33a9c06..df41303 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.930 + rev: v0.931 hooks: - id: mypy exclude: ^testing/ From 21d8f93bff640add942db82925db1393fc2b5050 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 15 Jan 2022 18:30:30 -0500 Subject: [PATCH 124/225] drop python3.6 support python 3.6 reached end of life on 2021-12-23 Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 4 ++-- README.md | 2 +- azure-pipelines.yml | 4 ++-- setup.cfg | 3 +-- setup.py | 2 ++ setuptools_golang.py | 26 ++++++++++++-------------- testing/dangling_symlink/setup.py | 2 ++ testing/defines/setup.py | 2 ++ testing/gomodules/setup.py | 2 ++ testing/imports_gh/setup.py | 2 ++ testing/internal_imports/setup.py | 2 ++ testing/multidir/setup.py | 2 ++ testing/notfound/setup.py | 2 ++ testing/project_with_c/setup.py | 2 ++ testing/sum/setup.py | 2 ++ testing/sum_pure_go/setup.py | 2 ++ testing/sum_sub_package/setup.py | 2 ++ tests/setuptools_golang_test.py | 2 ++ tox.ini | 2 +- 19 files changed, 45 insertions(+), 22 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index df41303..4c442e5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,12 +20,12 @@ repos: rev: v2.6.0 hooks: - id: reorder-python-imports - args: [--py3-plus] + args: [--py37-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/pyupgrade rev: v2.31.0 hooks: - id: pyupgrade - args: [--py36-plus] + args: [--py37-plus] - repo: https://github.com/asottile/add-trailing-comma rev: v2.2.1 hooks: diff --git a/README.md b/README.md index a673b76..52f3bba 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ A setuptools extension for building cpython extensions written in golang. This requires golang >= 1.5. It is currently tested against 1.16 and 1.17. -This requires python >= 3.6. It is currently tested against python3 and pypy3. +This requires python >= 3.7. It is currently tested against python3 and pypy3. ## Platform Support diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b64b42e..0563ea9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,7 +10,7 @@ resources: type: github endpoint: github name: asottile/azure-pipeline-templates - ref: refs/tags/v2.1.0 + ref: refs/tags/v2.4.0 jobs: - template: job--python-tox.yml@asottile @@ -24,7 +24,7 @@ jobs: version: '1.16.8' - template: job--python-tox.yml@asottile parameters: - toxenvs: [pypy3, py36, py37, py38] + toxenvs: [py37, py38] os: linux name_postfix: _go_1_17 pre_test: diff --git a/setup.cfg b/setup.cfg index f14c3de..262a576 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,7 +13,6 @@ classifiers = License :: OSI Approved :: MIT License Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -23,7 +22,7 @@ classifiers = [options] py_modules = setuptools_golang -python_requires = >=3.6.1 +python_requires = >=3.7 [options.entry_points] console_scripts = diff --git a/setup.py b/setup.py index 8bf1ba9..3d93aef 100644 --- a/setup.py +++ b/setup.py @@ -1,2 +1,4 @@ +from __future__ import annotations + from setuptools import setup setup() diff --git a/setuptools_golang.py b/setuptools_golang.py index a3abdd9..f4b332d 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import argparse import contextlib import copy @@ -14,12 +16,8 @@ from types import TracebackType from typing import Any from typing import Callable -from typing import Dict from typing import Generator -from typing import Optional from typing import Sequence -from typing import Tuple -from typing import Type from setuptools import Extension from setuptools.command.build_ext import build_ext as _build_ext @@ -30,7 +28,7 @@ def rmtree(path: str) -> None: def handle_remove_readonly( func: Callable[..., Any], path: str, - exc: Tuple[Type[OSError], OSError, TracebackType], + exc: tuple[type[OSError], OSError, TracebackType], ) -> None: excvalue = exc[1] if ( @@ -56,7 +54,7 @@ def _tmpdir() -> Generator[str, None, None]: def _get_cflags( compiler: CCompiler, - macros: Sequence[Tuple[str, Optional[str]]], + macros: Sequence[tuple[str, str | None]], ) -> str: args = [f'-I{p}' for p in compiler.include_dirs] for macro_name, macro_value in macros: @@ -101,7 +99,7 @@ def _get_ldflags() -> str: return LFLAG_GCC -def _check_call(cmd: Tuple[str, ...], cwd: str, env: Dict[str, str]) -> None: +def _check_call(cmd: tuple[str, ...], cwd: str, env: dict[str, str]) -> None: envparts = [f'{k}={shlex.quote(v)}' for k, v in sorted(tuple(env.items()))] print( '$ {}'.format(' '.join(envparts + [shlex.quote(p) for p in cmd])), @@ -111,7 +109,7 @@ def _check_call(cmd: Tuple[str, ...], cwd: str, env: Dict[str, str]) -> None: def _get_build_extension_method( - base: Type[_build_ext], + base: type[_build_ext], root: str, strip: bool, ) -> Callable[[_build_ext, Extension], None]: @@ -161,7 +159,7 @@ def build_extension(self: _build_ext, ext: Extension) -> None: 'CGO_LDFLAGS': _get_ldflags(), }) - cmd_build: Tuple[str, ...] = ( + cmd_build: tuple[str, ...] = ( 'go', 'build', '-buildmode=c-shared', '-o', os.path.abspath(self.get_ext_fullpath(ext.name)), ) @@ -176,10 +174,10 @@ def build_extension(self: _build_ext, ext: Extension) -> None: def _get_build_ext_cls( - base: Type[_build_ext], + base: type[_build_ext], root: str, strip: bool = True, -) -> Type[_build_ext]: +) -> type[_build_ext]: attrs = {'build_extension': _get_build_extension_method(base, root, strip)} return type('build_ext', (base,), attrs) @@ -187,7 +185,7 @@ def _get_build_ext_cls( def set_build_ext( dist: Distribution, attr: str, - value: Dict[str, Any], + value: dict[str, Any], ) -> None: base = dist.cmdclass.get('build_ext', _build_ext) dist.cmdclass['build_ext'] = _get_build_ext_cls(base, **value) @@ -207,7 +205,7 @@ def set_build_ext( def build_manylinux_wheels( - argv: Optional[Sequence[str]] = None, + argv: Sequence[str] | None = None, ) -> int: # pragma: no cover parser = argparse.ArgumentParser() parser.add_argument( @@ -215,7 +213,7 @@ def build_manylinux_wheels( help='Override golang version (default %(default)s)', ) parser.add_argument( - '--pythons', default='cp36-cp36m', + '--pythons', default='cp37-cp37m', help='Override pythons to build (default %(default)s)', ) args = parser.parse_args(argv) diff --git a/testing/dangling_symlink/setup.py b/testing/dangling_symlink/setup.py index 502822b..1c6c660 100644 --- a/testing/dangling_symlink/setup.py +++ b/testing/dangling_symlink/setup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from setuptools import Extension from setuptools import setup diff --git a/testing/defines/setup.py b/testing/defines/setup.py index 802cd69..ae5f84b 100644 --- a/testing/defines/setup.py +++ b/testing/defines/setup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from setuptools import Extension from setuptools import setup diff --git a/testing/gomodules/setup.py b/testing/gomodules/setup.py index 793f3f2..66fed65 100644 --- a/testing/gomodules/setup.py +++ b/testing/gomodules/setup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from setuptools import Extension from setuptools import setup diff --git a/testing/imports_gh/setup.py b/testing/imports_gh/setup.py index 6e98f79..b9fcc1e 100644 --- a/testing/imports_gh/setup.py +++ b/testing/imports_gh/setup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from setuptools import Extension from setuptools import setup diff --git a/testing/internal_imports/setup.py b/testing/internal_imports/setup.py index 8fd2741..f3d284e 100644 --- a/testing/internal_imports/setup.py +++ b/testing/internal_imports/setup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from setuptools import Extension from setuptools import setup diff --git a/testing/multidir/setup.py b/testing/multidir/setup.py index 0e26a0b..f2af1a9 100644 --- a/testing/multidir/setup.py +++ b/testing/multidir/setup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from setuptools import Extension from setuptools import setup diff --git a/testing/notfound/setup.py b/testing/notfound/setup.py index 2e47064..3cab498 100644 --- a/testing/notfound/setup.py +++ b/testing/notfound/setup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from setuptools import Extension from setuptools import setup diff --git a/testing/project_with_c/setup.py b/testing/project_with_c/setup.py index 8edff81..a604c61 100644 --- a/testing/project_with_c/setup.py +++ b/testing/project_with_c/setup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from setuptools import Extension from setuptools import find_packages from setuptools import setup diff --git a/testing/sum/setup.py b/testing/sum/setup.py index 33629ca..e0fa2f1 100644 --- a/testing/sum/setup.py +++ b/testing/sum/setup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from setuptools import Extension from setuptools import setup diff --git a/testing/sum_pure_go/setup.py b/testing/sum_pure_go/setup.py index 776b227..4f261f9 100644 --- a/testing/sum_pure_go/setup.py +++ b/testing/sum_pure_go/setup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from setuptools import Extension from setuptools import setup diff --git a/testing/sum_sub_package/setup.py b/testing/sum_sub_package/setup.py index 47dfbef..6114e80 100644 --- a/testing/sum_sub_package/setup.py +++ b/testing/sum_sub_package/setup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from setuptools import Extension from setuptools import find_packages from setuptools import setup diff --git a/tests/setuptools_golang_test.py b/tests/setuptools_golang_test.py index a671943..aab1475 100644 --- a/tests/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import collections import os import shlex diff --git a/tox.ini b/tox.ini index b8eb529..bdfe48b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36,py37,py38,pypy3,pre-commit +envlist = py37,py38,pypy3,pre-commit [testenv] deps = -rrequirements-dev.txt From 1023f1a844605ecfa61a414e33e77f64d019b939 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 31 Jan 2022 23:32:33 +0000 Subject: [PATCH 125/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v2.6.0 → v2.7.1](https://github.com/asottile/reorder_python_imports/compare/v2.6.0...v2.7.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c442e5..3711ce9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports - rev: v2.6.0 + rev: v2.7.1 hooks: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] From 5866be838082dfd807a7b8bde025ea89ea6f8cee Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 13 Mar 2022 19:52:04 -0400 Subject: [PATCH 126/225] remove unneeded gitignore lines - coverage-html: coverage>=6.2 writes a .gitignore file - mypy_cache: mypy>=0.770 writes a .gitignore file - pytest_cache: pytest>=3.8.1 writes a .gitignore file - venv: virtualenv>=20.0.21 writes a .gitignore file Committed via https://github.com/asottile/all-repos --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index 38f0e79..978f284 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,6 @@ *.pyc *.so /.coverage -/.mypy_cache -/.pytest_cache /.tox /build /dist -/venv* From 82f9496be6130448f00d7060143d06b8bda89c41 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 00:42:17 +0000 Subject: [PATCH 127/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v2.7.1 → v3.0.1](https://github.com/asottile/reorder_python_imports/compare/v2.7.1...v3.0.1) - [github.com/asottile/pyupgrade: v2.31.0 → v2.31.1](https://github.com/asottile/pyupgrade/compare/v2.31.0...v2.31.1) - [github.com/pre-commit/mirrors-mypy: v0.931 → v0.940](https://github.com/pre-commit/mirrors-mypy/compare/v0.931...v0.940) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3711ce9..c6a6997 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,12 +17,12 @@ repos: hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports - rev: v2.7.1 + rev: v3.0.1 hooks: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/pyupgrade - rev: v2.31.0 + rev: v2.31.1 hooks: - id: pyupgrade args: [--py37-plus] @@ -36,7 +36,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.931 + rev: v0.940 hooks: - id: mypy exclude: ^testing/ From 9c4edef6b69618394dace0e6b8a608b7f3dcf8bd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 00:45:45 +0000 Subject: [PATCH 128/225] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setuptools_golang.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index f4b332d..02cf980 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -11,14 +11,14 @@ import subprocess import sys import tempfile -from distutils.ccompiler import CCompiler -from distutils.dist import Distribution from types import TracebackType from typing import Any from typing import Callable from typing import Generator from typing import Sequence +from distutils.ccompiler import CCompiler +from distutils.dist import Distribution from setuptools import Extension from setuptools.command.build_ext import build_ext as _build_ext From bdf5673ce7dbc6e498ebf72c9703052ab8449647 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Mar 2022 00:55:03 +0000 Subject: [PATCH 129/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.940 → v0.941](https://github.com/pre-commit/mirrors-mypy/compare/v0.940...v0.941) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c6a6997..ae45dd5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.940 + rev: v0.941 hooks: - id: mypy exclude: ^testing/ From 1231cc3a145478ae895b99fc264bfce388e07886 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 24 Mar 2022 14:50:18 -0400 Subject: [PATCH 130/225] Update default branch to main Committed via https://github.com/asottile/all-repos --- README.md | 6 +++--- azure-pipelines.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 52f3bba..6cd77d9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -[![Build Status](https://dev.azure.com/asottile/asottile/_apis/build/status/asottile.setuptools-golang?branchName=master)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=52&branchName=master) -[![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/asottile/asottile/52/master.svg)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=52&branchName=master) -[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/setuptools-golang/master.svg)](https://results.pre-commit.ci/latest/github/asottile/setuptools-golang/master) +[![Build Status](https://dev.azure.com/asottile/asottile/_apis/build/status/asottile.setuptools-golang?branchName=main)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=52&branchName=main) +[![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/asottile/asottile/52/main.svg)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=52&branchName=main) +[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/setuptools-golang/main.svg)](https://results.pre-commit.ci/latest/github/asottile/setuptools-golang/main) setuptools-golang ================= diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0563ea9..776e42f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,6 @@ trigger: branches: - include: [master, test-me-*] + include: [main, test-me-*] tags: include: ['*'] From eac7955acdcaabb8dcb790eb9e8e8bdd4dc4056e Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 25 Mar 2022 14:06:53 -0400 Subject: [PATCH 131/225] reorder pre-commit config Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 36 ++++++++++++++++----------------- tests/setuptools_golang_test.py | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ae45dd5..721774c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,46 +4,46 @@ repos: hooks: - id: trailing-whitespace - id: end-of-file-fixer - - id: check-docstring-first - id: check-yaml - id: debug-statements + - id: double-quote-string-fixer + - id: name-tests-test - id: requirements-txt-fixer -- repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 - hooks: - - id: flake8 -- repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.6.0 +- repo: https://github.com/asottile/setup-cfg-fmt + rev: v1.20.0 hooks: - - id: autopep8 + - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder_python_imports rev: v3.0.1 hooks: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] +- repo: https://github.com/asottile/add-trailing-comma + rev: v2.2.1 + hooks: + - id: add-trailing-comma + args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade rev: v2.31.1 hooks: - id: pyupgrade args: [--py37-plus] -- repo: https://github.com/asottile/add-trailing-comma - rev: v2.2.1 +- repo: https://github.com/pre-commit/mirrors-autopep8 + rev: v1.6.0 hooks: - - id: add-trailing-comma - args: [--py36-plus] -- repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.0 + - id: autopep8 +- repo: https://github.com/PyCQA/flake8 + rev: 4.0.1 hooks: - - id: setup-cfg-fmt + - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.941 + rev: v0.942 hooks: - id: mypy - exclude: ^testing/ - repo: local hooks: - id: gofmt name: gofmt language: system entry: gofmt -l -w - files: \.go$ + types: [go] diff --git a/tests/setuptools_golang_test.py b/tests/setuptools_golang_test.py index aab1475..c9c1819 100644 --- a/tests/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -160,7 +160,7 @@ def test_integration_user_gopath(venv, tmpdir): stderr=subprocess.STDOUT, ) - assert f"$ GOPATH={shlex.quote(gopath)} go get -d" in ret.out + assert f'$ GOPATH={shlex.quote(gopath)} go get -d' in ret.out def test_integration_defines(venv): From a2a1b35b6eadfa93b790e8a6eae87f2b27fbf4a4 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 25 Mar 2022 14:51:00 -0400 Subject: [PATCH 132/225] fix pre-commit issues --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 721774c..f6de59b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,6 +40,7 @@ repos: rev: v0.942 hooks: - id: mypy + exclude: ^testing/ - repo: local hooks: - id: gofmt From cea466da5f80fadc00bc715cc47179405fc868f3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 21:35:43 +0000 Subject: [PATCH 133/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/setup-cfg-fmt: v1.20.0 → v1.20.1](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.0...v1.20.1) - [github.com/asottile/add-trailing-comma: v2.2.1 → v2.2.2](https://github.com/asottile/add-trailing-comma/compare/v2.2.1...v2.2.2) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f6de59b..4a8dc6a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.0 + rev: v1.20.1 hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder_python_imports @@ -19,7 +19,7 @@ repos: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/add-trailing-comma - rev: v2.2.1 + rev: v2.2.2 hooks: - id: add-trailing-comma args: [--py36-plus] From 4e02abb51a46f3e14086144564142b6376ab9ce4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 22:56:29 +0000 Subject: [PATCH 134/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.1.0 → v4.2.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.1.0...v4.2.0) - [github.com/asottile/pyupgrade: v2.31.1 → v2.32.0](https://github.com/asottile/pyupgrade/compare/v2.31.1...v2.32.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4a8dc6a..7fa53dd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.2.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.31.1 + rev: v2.32.0 hooks: - id: pyupgrade args: [--py37-plus] From 172e0f256f0a6b16a00676605e5d8d7b678c65e0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 21:25:57 +0000 Subject: [PATCH 135/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/add-trailing-comma: v2.2.2 → v2.2.3](https://github.com/asottile/add-trailing-comma/compare/v2.2.2...v2.2.3) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7fa53dd..954141b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/add-trailing-comma - rev: v2.2.2 + rev: v2.2.3 hooks: - id: add-trailing-comma args: [--py36-plus] From 0ece0db6052d3bb0f5eede670cb84f421ab1abb1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 May 2022 21:56:55 +0000 Subject: [PATCH 136/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.0.1 → v3.1.0](https://github.com/asottile/reorder_python_imports/compare/v3.0.1...v3.1.0) - [github.com/pre-commit/mirrors-mypy: v0.942 → v0.950](https://github.com/pre-commit/mirrors-mypy/compare/v0.942...v0.950) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 954141b..7e563a1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder_python_imports - rev: v3.0.1 + rev: v3.1.0 hooks: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.942 + rev: v0.950 hooks: - id: mypy exclude: ^testing/ From 6b4924200d6e5b16585cc7edbc7b27614c75452f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 22:06:09 +0000 Subject: [PATCH 137/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.32.0 → v2.32.1](https://github.com/asottile/pyupgrade/compare/v2.32.0...v2.32.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e563a1..5dc0a54 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.32.0 + rev: v2.32.1 hooks: - id: pyupgrade args: [--py37-plus] From 5cb3bb114909b67d591183cc806f778411e051d0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 May 2022 22:09:34 +0000 Subject: [PATCH 138/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.950 → v0.960](https://github.com/pre-commit/mirrors-mypy/compare/v0.950...v0.960) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5dc0a54..5f38d0c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.950 + rev: v0.960 hooks: - id: mypy exclude: ^testing/ From e550dd3dbe652edf2e7a6fce143c2153b3798fba Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 21:57:13 +0000 Subject: [PATCH 139/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.32.1 → v2.33.0](https://github.com/asottile/pyupgrade/compare/v2.32.1...v2.33.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5f38d0c..4a557d3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.32.1 + rev: v2.33.0 hooks: - id: pyupgrade args: [--py37-plus] From ff40d6ae31740407c69c712272e5f5afb33d8c60 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Jun 2022 00:04:12 +0000 Subject: [PATCH 140/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.2.0 → v4.3.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.2.0...v4.3.0) - [github.com/asottile/pyupgrade: v2.33.0 → v2.34.0](https://github.com/asottile/pyupgrade/compare/v2.33.0...v2.34.0) - [github.com/pre-commit/mirrors-mypy: v0.960 → v0.961](https://github.com/pre-commit/mirrors-mypy/compare/v0.960...v0.961) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4a557d3..d1efc7a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.33.0 + rev: v2.34.0 hooks: - id: pyupgrade args: [--py37-plus] @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.960 + rev: v0.961 hooks: - id: mypy exclude: ^testing/ From 7963c1d8ef33898f37814fdace64aabd08e219f7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 5 Jul 2022 00:14:56 +0000 Subject: [PATCH 141/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.1.0 → v3.3.0](https://github.com/asottile/reorder_python_imports/compare/v3.1.0...v3.3.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d1efc7a..2a4b231 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder_python_imports - rev: v3.1.0 + rev: v3.3.0 hooks: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] From 100aeb1197864b4a9c2d2dffebd19b0c885ee5ac Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 23:17:36 +0000 Subject: [PATCH 142/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.3.0 → v3.8.1](https://github.com/asottile/reorder_python_imports/compare/v3.3.0...v3.8.1) - [github.com/asottile/pyupgrade: v2.34.0 → v2.37.1](https://github.com/asottile/pyupgrade/compare/v2.34.0...v2.37.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2a4b231..adcffce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder_python_imports - rev: v3.3.0 + rev: v3.8.1 hooks: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.34.0 + rev: v2.37.1 hooks: - id: pyupgrade args: [--py37-plus] From d1285e537db37ee10dd6c55a5914ede894cfb5e9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 23:41:26 +0000 Subject: [PATCH 143/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/setup-cfg-fmt: v1.20.1 → v1.20.2](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.1...v1.20.2) - [github.com/asottile/reorder_python_imports: v3.8.1 → v3.8.2](https://github.com/asottile/reorder_python_imports/compare/v3.8.1...v3.8.2) - [github.com/asottile/pyupgrade: v2.37.1 → v2.37.2](https://github.com/asottile/pyupgrade/compare/v2.37.1...v2.37.2) - [github.com/pre-commit/mirrors-mypy: v0.961 → v0.971](https://github.com/pre-commit/mirrors-mypy/compare/v0.961...v0.971) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index adcffce..029e85d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,11 +10,11 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.1 + rev: v1.20.2 hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.1 + rev: v3.8.2 hooks: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.37.1 + rev: v2.37.2 hooks: - id: pyupgrade args: [--py37-plus] @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.961 + rev: v0.971 hooks: - id: mypy exclude: ^testing/ From 755127b5e1aadb27cda65c7a8b7996e52c2c4cad Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Aug 2022 00:59:37 +0000 Subject: [PATCH 144/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/setup-cfg-fmt: v1.20.2 → v2.0.0](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.2...v2.0.0) - [github.com/asottile/pyupgrade: v2.37.2 → v2.37.3](https://github.com/asottile/pyupgrade/compare/v2.37.2...v2.37.3) - [github.com/PyCQA/flake8: 4.0.1 → 5.0.3](https://github.com/PyCQA/flake8/compare/4.0.1...5.0.3) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 029e85d..4c418f6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.2 + rev: v2.0.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder_python_imports @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.37.2 + rev: v2.37.3 hooks: - id: pyupgrade args: [--py37-plus] @@ -33,7 +33,7 @@ repos: hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 + rev: 5.0.3 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy From 9f5ab83be807132c46bd838284fc62eb3044a59e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Aug 2022 01:03:23 +0000 Subject: [PATCH 145/225] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.cfg | 4 ---- 1 file changed, 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index 262a576..ea0f77c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,10 +13,6 @@ classifiers = License :: OSI Approved :: MIT License Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy From 116725fe8decb74442f2b731a945cac1823d0155 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Aug 2022 00:37:36 +0000 Subject: [PATCH 146/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 5.0.3 → 5.0.4](https://github.com/PyCQA/flake8/compare/5.0.3...5.0.4) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c418f6..fcb9e3c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 - rev: 5.0.3 + rev: 5.0.4 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy From c04f332be5db1337b3f12066562af4bd3f7a54fb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 23:02:42 +0000 Subject: [PATCH 147/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-autopep8: v1.6.0 → v1.7.0](https://github.com/pre-commit/mirrors-autopep8/compare/v1.6.0...v1.7.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fcb9e3c..3dd688d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.6.0 + rev: v1.7.0 hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 From 9df2d8131b05a231a3c4d88f5a1c01e61f319c7a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 20 Sep 2022 00:52:50 +0000 Subject: [PATCH 148/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.37.3 → v2.38.0](https://github.com/asottile/pyupgrade/compare/v2.37.3...v2.38.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3dd688d..d98b8ff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.37.3 + rev: v2.38.0 hooks: - id: pyupgrade args: [--py37-plus] From ea139cc3ec66fbc50f19efa8ff67078354d04231 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 01:07:38 +0000 Subject: [PATCH 149/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.8.2 → v3.8.3](https://github.com/asottile/reorder_python_imports/compare/v3.8.2...v3.8.3) - [github.com/asottile/add-trailing-comma: v2.2.3 → v2.3.0](https://github.com/asottile/add-trailing-comma/compare/v2.2.3...v2.3.0) - [github.com/asottile/pyupgrade: v2.38.0 → v2.38.2](https://github.com/asottile/pyupgrade/compare/v2.38.0...v2.38.2) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d98b8ff..bcc716b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,17 +14,17 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.2 + rev: v3.8.3 hooks: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/add-trailing-comma - rev: v2.2.3 + rev: v2.3.0 hooks: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.38.0 + rev: v2.38.2 hooks: - id: pyupgrade args: [--py37-plus] From 0ae50613fbc1fb378313ac73fa72ac4bc35fa6b2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Oct 2022 01:03:20 +0000 Subject: [PATCH 150/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.971 → v0.981](https://github.com/pre-commit/mirrors-mypy/compare/v0.971...v0.981) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bcc716b..b43b63a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.971 + rev: v0.981 hooks: - id: mypy exclude: ^testing/ From ff703e9e41ef2b589aa364612cec613eb512f0eb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Oct 2022 02:25:08 +0000 Subject: [PATCH 151/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.8.3 → v3.8.4](https://github.com/asottile/reorder_python_imports/compare/v3.8.3...v3.8.4) - [github.com/asottile/pyupgrade: v2.38.2 → v3.1.0](https://github.com/asottile/pyupgrade/compare/v2.38.2...v3.1.0) - [github.com/pre-commit/mirrors-mypy: v0.981 → v0.982](https://github.com/pre-commit/mirrors-mypy/compare/v0.981...v0.982) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b43b63a..2d3d256 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.3 + rev: v3.8.4 hooks: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.38.2 + rev: v3.1.0 hooks: - id: pyupgrade args: [--py37-plus] @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.981 + rev: v0.982 hooks: - id: mypy exclude: ^testing/ From 647618d3a8640c20352f3424f7ea0b4ae5d15a51 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 01:23:03 +0000 Subject: [PATCH 152/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/setup-cfg-fmt: v2.0.0 → v2.1.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.0.0...v2.1.0) - [github.com/asottile/reorder_python_imports: v3.8.4 → v3.8.5](https://github.com/asottile/reorder_python_imports/compare/v3.8.4...v3.8.5) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2d3d256..a9b8710 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,11 +10,11 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.0.0 + rev: v2.1.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.4 + rev: v3.8.5 hooks: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] From 159210466e861dbc92896a74670be11502bf19ef Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 1 Nov 2022 01:52:24 +0000 Subject: [PATCH 153/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/setup-cfg-fmt: v2.1.0 → v2.2.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.1.0...v2.2.0) - [github.com/asottile/reorder_python_imports: v3.8.5 → v3.9.0](https://github.com/asottile/reorder_python_imports/compare/v3.8.5...v3.9.0) - [github.com/asottile/pyupgrade: v3.1.0 → v3.2.0](https://github.com/asottile/pyupgrade/compare/v3.1.0...v3.2.0) - [github.com/pre-commit/mirrors-autopep8: v1.7.0 → v2.0.0](https://github.com/pre-commit/mirrors-autopep8/compare/v1.7.0...v2.0.0) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a9b8710..159958c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,11 +10,11 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.1.0 + rev: v2.2.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.5 + rev: v3.9.0 hooks: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] @@ -24,12 +24,12 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.1.0 + rev: v3.2.0 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.7.0 + rev: v2.0.0 hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 From 634cf95e3e852378a65fd7ad627df4e92d13ad3b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 01:53:04 +0000 Subject: [PATCH 154/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.2.0 → v3.2.2](https://github.com/asottile/pyupgrade/compare/v3.2.0...v3.2.2) - [github.com/pre-commit/mirrors-mypy: v0.982 → v0.990](https://github.com/pre-commit/mirrors-mypy/compare/v0.982...v0.990) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 159958c..91b431d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.2.0 + rev: v3.2.2 hooks: - id: pyupgrade args: [--py37-plus] @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.982 + rev: v0.990 hooks: - id: mypy exclude: ^testing/ From d04eca38a66c84de9fbfb9ba69c87769effab780 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 16 Nov 2022 19:17:27 -0500 Subject: [PATCH 155/225] remove no_implicit_optional this is the default in mypy 0.990 Committed via https://github.com/asottile/all-repos --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index ea0f77c..c25d4d5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,7 +40,6 @@ check_untyped_defs = true disallow_any_generics = true disallow_incomplete_defs = true disallow_untyped_defs = true -no_implicit_optional = true warn_redundant_casts = true warn_unused_ignores = true From 60fafde40758ac97a33c189d86a10a4252764956 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 01:18:20 +0000 Subject: [PATCH 156/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.990 → v0.991](https://github.com/pre-commit/mirrors-mypy/compare/v0.990...v0.991) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91b431d..fb7e4a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.990 + rev: v0.991 hooks: - id: mypy exclude: ^testing/ From 95ac5f9efebcf0d72f82e8190f2f6d860a19e4a2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 29 Nov 2022 04:01:18 +0000 Subject: [PATCH 157/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.3.0...v4.4.0) - [github.com/PyCQA/flake8: 5.0.4 → 6.0.0](https://github.com/PyCQA/flake8/compare/5.0.4...6.0.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fb7e4a5..01fd245 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -33,7 +33,7 @@ repos: hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 + rev: 6.0.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy From 4ee873c5fef2558e937e771f312bd0c3e59d9d20 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 6 Dec 2022 02:18:41 +0000 Subject: [PATCH 158/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.2.2 → v3.3.0](https://github.com/asottile/pyupgrade/compare/v3.2.2...v3.3.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 01fd245..28191a9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.2.2 + rev: v3.3.0 hooks: - id: pyupgrade args: [--py37-plus] From b6ebb0c1ff037645723f20c01e1dea03d4ad94af Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 03:25:31 +0000 Subject: [PATCH 159/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/add-trailing-comma: v2.3.0 → v2.4.0](https://github.com/asottile/add-trailing-comma/compare/v2.3.0...v2.4.0) - [github.com/asottile/pyupgrade: v3.3.0 → v3.3.1](https://github.com/asottile/pyupgrade/compare/v3.3.0...v3.3.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 28191a9..a90f3e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,12 +19,12 @@ repos: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/add-trailing-comma - rev: v2.3.0 + rev: v2.4.0 hooks: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.3.0 + rev: v3.3.1 hooks: - id: pyupgrade args: [--py37-plus] From 24d3bfd15cd6f0e83a0f12d337661243f1ff206e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 20 Dec 2022 03:32:20 +0000 Subject: [PATCH 160/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-autopep8: v2.0.0 → v2.0.1](https://github.com/pre-commit/mirrors-autopep8/compare/v2.0.0...v2.0.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a90f3e8..01f60d9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v2.0.0 + rev: v2.0.1 hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 From 8f0d7448ece065ff58f95586209354406eaf4a70 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 29 Dec 2022 20:35:11 -0500 Subject: [PATCH 161/225] azure pipelines -> github actions --- .github/actions/pre-test/action.yml | 4 ++++ .github/workflows/main.yml | 14 ++++++++++++ README.md | 5 ++--- azure-pipelines.yml | 33 ----------------------------- 4 files changed, 20 insertions(+), 36 deletions(-) create mode 100644 .github/actions/pre-test/action.yml create mode 100644 .github/workflows/main.yml delete mode 100644 azure-pipelines.yml diff --git a/.github/actions/pre-test/action.yml b/.github/actions/pre-test/action.yml new file mode 100644 index 0000000..560b489 --- /dev/null +++ b/.github/actions/pre-test/action.yml @@ -0,0 +1,4 @@ +runs: + using: composite + steps: + - uses: actions/setup-go@v3 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..7464e4c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,14 @@ +name: main + +on: + push: + branches: [main, test-me-*] + tags: + pull_request: + +jobs: + main: + uses: asottile/workflows/.github/workflows/tox.yml@v1.2.0 + with: + env: '["pypy3", "py37", "py38", "py39", "py310"]' + os: ubuntu-latest diff --git a/README.md b/README.md index 6cd77d9..eb9f13e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -[![Build Status](https://dev.azure.com/asottile/asottile/_apis/build/status/asottile.setuptools-golang?branchName=main)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=52&branchName=main) -[![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/asottile/asottile/52/main.svg)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=52&branchName=main) +[![build status](https://github.com/asottile/setuptools-golang/actions/workflows/main.yml/badge.svg)](https://github.com/asottile/setuptools-golang/actions/workflows/main.yml) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/setuptools-golang/main.svg)](https://results.pre-commit.ci/latest/github/asottile/setuptools-golang/main) setuptools-golang @@ -9,7 +8,7 @@ A setuptools extension for building cpython extensions written in golang. ## Requirements -This requires golang >= 1.5. It is currently tested against 1.16 and 1.17. +This requires golang >= 1.5. This requires python >= 3.7. It is currently tested against python3 and pypy3. diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 776e42f..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,33 +0,0 @@ -trigger: - branches: - include: [main, test-me-*] - tags: - include: ['*'] - -resources: - repositories: - - repository: asottile - type: github - endpoint: github - name: asottile/azure-pipeline-templates - ref: refs/tags/v2.4.0 - -jobs: -- template: job--python-tox.yml@asottile - parameters: - toxenvs: [py38] - os: linux - name_postfix: _go_1_16 - pre_test: - - task: GoTool@0 - inputs: - version: '1.16.8' -- template: job--python-tox.yml@asottile - parameters: - toxenvs: [py37, py38] - os: linux - name_postfix: _go_1_17 - pre_test: - - task: GoTool@0 - inputs: - version: '1.17.1' From 06de6e3d5345663efb3b716c1cabb18ac3af96ea Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 05:33:34 +0000 Subject: [PATCH 162/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.991 → v1.0.0](https://github.com/pre-commit/mirrors-mypy/compare/v0.991...v1.0.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 01f60d9..76543b9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.991 + rev: v1.0.0 hooks: - id: mypy exclude: ^testing/ From c9f320ddb863d5959a045cac249a8e4244e86e37 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 21 Feb 2023 05:16:03 +0000 Subject: [PATCH 163/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.0.0 → v1.0.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.0.0...v1.0.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 76543b9..84ef241 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.0.0 + rev: v1.0.1 hooks: - id: mypy exclude: ^testing/ From 0dd771bedbdcdca7099cc12d8e48577ba0e4047a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 06:14:14 +0000 Subject: [PATCH 164/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-autopep8: v2.0.1 → v2.0.2](https://github.com/pre-commit/mirrors-autopep8/compare/v2.0.1...v2.0.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 84ef241..3e15569 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v2.0.1 + rev: v2.0.2 hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 From 42b142ad91ffcb766280afd5c8dc97805f0a947a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 06:39:38 +0000 Subject: [PATCH 165/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.0.1 → v1.1.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.0.1...v1.1.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3e15569..9a664d7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.0.1 + rev: v1.1.1 hooks: - id: mypy exclude: ^testing/ From 3520e5f4571ee9c15367ded9554781f7365a0675 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Apr 2023 06:21:45 +0000 Subject: [PATCH 166/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.1.1 → v1.2.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.1.1...v1.2.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9a664d7..2aa2103 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.1.1 + rev: v1.2.0 hooks: - id: mypy exclude: ^testing/ From 914749e617419010a85bcffac688a45f7cef3c24 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 25 Apr 2023 07:08:47 +0000 Subject: [PATCH 167/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.3.1 → v3.3.2](https://github.com/asottile/pyupgrade/compare/v3.3.1...v3.3.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2aa2103..869738a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + rev: v3.3.2 hooks: - id: pyupgrade args: [--py37-plus] From a70374666f797ea3cb97cd86171c95b57b0c398f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 May 2023 07:57:00 +0000 Subject: [PATCH 168/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - https://github.com/asottile/reorder_python_imports → https://github.com/asottile/reorder-python-imports - [github.com/asottile/pyupgrade: v3.3.2 → v3.4.0](https://github.com/asottile/pyupgrade/compare/v3.3.2...v3.4.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 869738a..c87c366 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: rev: v2.2.0 hooks: - id: setup-cfg-fmt -- repo: https://github.com/asottile/reorder_python_imports +- repo: https://github.com/asottile/reorder-python-imports rev: v3.9.0 hooks: - id: reorder-python-imports @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.3.2 + rev: v3.4.0 hooks: - id: pyupgrade args: [--py37-plus] From 12fd75efd852e791e4b40ca329e24bd69e0f0c5e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 07:02:17 +0000 Subject: [PATCH 169/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.2.0 → v1.3.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.2.0...v1.3.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c87c366..a0fcdb8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.2.0 + rev: v1.3.0 hooks: - id: mypy exclude: ^testing/ From 184b240f46d04cba03ab8a220dccb89dc2e7b938 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 1 Jun 2023 19:11:01 -0400 Subject: [PATCH 170/225] fix tags trigger for github actions the old syntax worked for azure pipelines but not GHA Committed via https://github.com/asottile/all-repos --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7464e4c..10fdc72 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: main on: push: branches: [main, test-me-*] - tags: + tags: '*' pull_request: jobs: From 171a1cc158a7bb4c1dbd28a2e532fc8fc0970e46 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 06:55:33 +0000 Subject: [PATCH 171/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/setup-cfg-fmt: v2.2.0 → v2.3.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.2.0...v2.3.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a0fcdb8..85db4a0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.2.0 + rev: v2.3.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder-python-imports From dbfb9e7981f4980ac4412439cc93bf67ea20af1e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 06:56:41 +0000 Subject: [PATCH 172/225] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index c25d4d5..59858bb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,7 +8,7 @@ url = https://github.com/asottile/setuptools-golang author = Anthony Sottile author_email = asottile@umich.edu license = MIT -license_file = LICENSE +license_files = LICENSE classifiers = License :: OSI Approved :: MIT License Programming Language :: Python :: 3 From b14c75c6736f60c0c367ea9ec63bcd1bbf2c1974 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 10 Jun 2023 15:02:04 -0400 Subject: [PATCH 173/225] fix dependencies for installation --- setup.cfg | 2 ++ tests/setuptools_golang_test.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/setup.cfg b/setup.cfg index 59858bb..903504f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,6 +18,8 @@ classifiers = [options] py_modules = setuptools_golang +install_requires = + setuptools python_requires = >=3.7 [options.entry_points] diff --git a/tests/setuptools_golang_test.py b/tests/setuptools_golang_test.py index c9c1819..81fdaaa 100644 --- a/tests/setuptools_golang_test.py +++ b/tests/setuptools_golang_test.py @@ -63,6 +63,8 @@ def venv(tmpdir_factory): run('virtualenv', venv.strpath, '-p', sys.executable) # Install this so we can get coverage run(pip, 'install', 'covdefaults>=1.2.0', 'coverage-enable-subprocess') + # Install wheel as well so we can non-pep517 + run(pip, 'install', 'wheel') # Install us! run(pip, 'install', '-e', '.') yield auto_namedtuple(venv=venv, pip=pip, python=python) From 074b66e3a62e8a4bc19e86d9ec2711e05b737fe7 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 10 Jun 2023 15:08:29 -0400 Subject: [PATCH 174/225] v2.8.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 903504f..616e9d5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 2.7.0 +version = 2.8.0 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From 9157916c0f677894ccdb8516be9bfd3f193be746 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 10 Jun 2023 15:26:50 -0400 Subject: [PATCH 175/225] add tests for 3.12 since it failed --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 10fdc72..b28829e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ on: jobs: main: - uses: asottile/workflows/.github/workflows/tox.yml@v1.2.0 + uses: asottile/workflows/.github/workflows/tox.yml@v1.5.0 with: - env: '["pypy3", "py37", "py38", "py39", "py310"]' + env: '["pypy3", "py38", "py39", "py310", "py311", "py312"]' os: ubuntu-latest From 5f652b41825da910a059110f329ab3ab6a35c522 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 07:56:56 +0000 Subject: [PATCH 176/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/add-trailing-comma: v2.4.0 → v2.5.1](https://github.com/asottile/add-trailing-comma/compare/v2.4.0...v2.5.1) - [github.com/asottile/pyupgrade: v3.4.0 → v3.6.0](https://github.com/asottile/pyupgrade/compare/v3.4.0...v3.6.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 85db4a0..b4b72c8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,12 +19,12 @@ repos: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/add-trailing-comma - rev: v2.4.0 + rev: v2.5.1 hooks: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.4.0 + rev: v3.6.0 hooks: - id: pyupgrade args: [--py37-plus] From e6d68b59c724a9134a13c48dc957fc346e41ec9e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 08:41:40 +0000 Subject: [PATCH 177/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder-python-imports: v3.9.0 → v3.10.0](https://github.com/asottile/reorder-python-imports/compare/v3.9.0...v3.10.0) - [github.com/asottile/pyupgrade: v3.6.0 → v3.7.0](https://github.com/asottile/pyupgrade/compare/v3.6.0...v3.7.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b4b72c8..2ba0a08 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder-python-imports - rev: v3.9.0 + rev: v3.10.0 hooks: - id: reorder-python-imports args: [--py37-plus, --add-import, 'from __future__ import annotations'] @@ -24,7 +24,7 @@ repos: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.6.0 + rev: v3.7.0 hooks: - id: pyupgrade args: [--py37-plus] From 18c9082580cd0aab25b21da1f6020136a90e4cbd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 27 Jun 2023 07:44:26 +0000 Subject: [PATCH 178/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.3.0 → v1.4.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.3.0...v1.4.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ba0a08..a106c28 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.3.0 + rev: v1.4.1 hooks: - id: mypy exclude: ^testing/ From d721d16325c3a31fd539048f61ebe7d33ec53487 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 1 Jul 2023 15:26:56 -0400 Subject: [PATCH 179/225] py38-plus Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 11 +++++------ setup.cfg | 2 +- tox.ini | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a106c28..30a461a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,24 +10,23 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.3.0 + rev: v2.4.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder-python-imports rev: v3.10.0 hooks: - id: reorder-python-imports - args: [--py37-plus, --add-import, 'from __future__ import annotations'] + args: [--py38-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/add-trailing-comma - rev: v2.5.1 + rev: v3.0.0 hooks: - id: add-trailing-comma - args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.7.0 + rev: v3.8.0 hooks: - id: pyupgrade - args: [--py37-plus] + args: [--py38-plus] - repo: https://github.com/pre-commit/mirrors-autopep8 rev: v2.0.2 hooks: diff --git a/setup.cfg b/setup.cfg index 616e9d5..70bb972 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ classifiers = py_modules = setuptools_golang install_requires = setuptools -python_requires = >=3.7 +python_requires = >=3.8 [options.entry_points] console_scripts = diff --git a/tox.ini b/tox.ini index bdfe48b..f7bb971 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py37,py38,pypy3,pre-commit +envlist = py,pre-commit [testenv] deps = -rrequirements-dev.txt From 0357e24f986bb9321755b3029390dd3579bc35a3 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 1 Jul 2023 17:31:13 -0400 Subject: [PATCH 180/225] shlex.join is always available in 3.8+ --- setuptools_golang.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index 02cf980..6c7bba0 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -101,10 +101,7 @@ def _get_ldflags() -> str: def _check_call(cmd: tuple[str, ...], cwd: str, env: dict[str, str]) -> None: envparts = [f'{k}={shlex.quote(v)}' for k, v in sorted(tuple(env.items()))] - print( - '$ {}'.format(' '.join(envparts + [shlex.quote(p) for p in cmd])), - file=sys.stderr, - ) + print(f'$ {" ".join(envparts)} {shlex.join(cmd)}', file=sys.stderr) subprocess.check_call(cmd, cwd=cwd, env=dict(os.environ, **env)) From 40c87acedfa3962af4e7980283555186e8987a95 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 10:11:40 +0000 Subject: [PATCH 181/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.8.0 → v3.9.0](https://github.com/asottile/pyupgrade/compare/v3.8.0...v3.9.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 30a461a..eaa5000 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.8.0 + rev: v3.9.0 hooks: - id: pyupgrade args: [--py38-plus] From 59be4ea5774eba4c68870a6ad16287fe9030c920 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 25 Jul 2023 16:48:18 -0400 Subject: [PATCH 182/225] remove python 2 virtualenv remnants --- .github/workflows/main.yml | 7 ++++++- setuptools_golang.py | 41 +++++++++++++++++++------------------- tox.ini | 1 + 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b28829e..c6601ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,12 @@ on: pull_request: jobs: - main: + main-windows: + uses: asottile/workflows/.github/workflows/tox.yml@v1.5.0 + with: + env: '["py38"]' + os: windows-latest + main-linux: uses: asottile/workflows/.github/workflows/tox.yml@v1.5.0 with: env: '["pypy3", "py38", "py39", "py310", "py311", "py312"]' diff --git a/setuptools_golang.py b/setuptools_golang.py index 6c7bba0..5570ffe 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -76,27 +76,26 @@ def _get_ldflags() -> str: """ # windows gcc does not support linking with unresolved symbols if sys.platform == 'win32': # pragma: win32 cover - prefix = getattr(sys, 'real_prefix', sys.prefix) - libs = os.path.join(prefix, 'libs') - return '-L{} -lpython{}{}'.format(libs, *sys.version_info[:2]) - - cc = subprocess.check_output(('go', 'env', 'CC')).decode('UTF-8').strip() - - with _tmpdir() as tmpdir: - testf = os.path.join(tmpdir, 'test.c') - with open(testf, 'w') as f: - f.write('int f(int); int main(void) { return f(0); }\n') - - for lflag in LFLAGS: # pragma: no cover (platform specific) - try: - subprocess.check_call((cc, testf, lflag), cwd=tmpdir) - return lflag - except subprocess.CalledProcessError: - pass - else: # pragma: no cover (platform specific) - # wellp, none of them worked, fall back to gcc and they'll get a - # hopefully reasonable error message - return LFLAG_GCC + libs = os.path.join(sys.base_prefix, 'libs') + return f'-L{libs} -lpython{sys.version_info[0]}' + else: # pragma: win32 no cover + cc = subprocess.check_output(('go', 'env', 'CC')).decode().strip() + + with _tmpdir() as tmpdir: + testf = os.path.join(tmpdir, 'test.c') + with open(testf, 'w') as f: + f.write('int f(int); int main(void) { return f(0); }\n') + + for lflag in LFLAGS: # pragma: no cover (platform specific) + try: + subprocess.check_call((cc, testf, lflag), cwd=tmpdir) + return lflag + except subprocess.CalledProcessError: + pass + else: # pragma: no cover (platform specific) + # wellp, none of them worked, fall back to gcc and they'll get + # a hopefully reasonable error message + return LFLAG_GCC def _check_call(cmd: tuple[str, ...], cwd: str, env: dict[str, str]) -> None: diff --git a/tox.ini b/tox.ini index f7bb971..4e4a4dc 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,7 @@ envlist = py,pre-commit [testenv] deps = -rrequirements-dev.txt +passenv = * setenv = PWD={toxinidir} commands = coverage erase From 541d65088e75c6e9eb91db3517a1c334b88854a9 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 29 Jul 2023 16:05:22 -0400 Subject: [PATCH 183/225] v2.9.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 70bb972..47dc4fa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools_golang -version = 2.8.0 +version = 2.9.0 description = A setuptools extension for building cpython extensions written in golang. long_description = file: README.md long_description_content_type = text/markdown From 785f4c111e33f3ebba0d71e0c8f7e3f2b9e65505 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 29 Jul 2023 16:08:05 -0400 Subject: [PATCH 184/225] it mysteriously works on windows now --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eb9f13e..ab855d0 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This requires python >= 3.7. It is currently tested against python3 and pypy3. - linux - macOS -- win32 (32 bit cpython, 32 bit go 1.10+) +- win32 ## Usage From 34248f1d9621a03d010faaf1330b0af32a321dfc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 1 Aug 2023 12:21:16 +0000 Subject: [PATCH 185/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/add-trailing-comma: v3.0.0 → v3.0.1](https://github.com/asottile/add-trailing-comma/compare/v3.0.0...v3.0.1) - [github.com/asottile/pyupgrade: v3.9.0 → v3.10.1](https://github.com/asottile/pyupgrade/compare/v3.9.0...v3.10.1) - [github.com/PyCQA/flake8: 6.0.0 → 6.1.0](https://github.com/PyCQA/flake8/compare/6.0.0...6.1.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eaa5000..4c98567 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,11 +19,11 @@ repos: - id: reorder-python-imports args: [--py38-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/add-trailing-comma - rev: v3.0.0 + rev: v3.0.1 hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.9.0 + rev: v3.10.1 hooks: - id: pyupgrade args: [--py38-plus] @@ -32,7 +32,7 @@ repos: hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 6.1.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy From 6aacd77d5a2c6d576c3b77cb4d2341c2508a4aa3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Aug 2023 10:28:43 +0000 Subject: [PATCH 186/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.4.1 → v1.5.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.4.1...v1.5.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c98567..2fc0e33 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.4.1 + rev: v1.5.0 hooks: - id: mypy exclude: ^testing/ From 75e785d139e9994d3ba089bf4966a4342165f458 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 10:59:09 +0000 Subject: [PATCH 187/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.5.0 → v1.5.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.5.0...v1.5.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2fc0e33..26b79ec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.5.0 + rev: v1.5.1 hooks: - id: mypy exclude: ^testing/ From 01da3d0714a55154228e44c181db2afb3f924181 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 29 Aug 2023 10:05:30 +0000 Subject: [PATCH 188/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-autopep8: v2.0.2 → v2.0.4](https://github.com/pre-commit/mirrors-autopep8/compare/v2.0.2...v2.0.4) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 26b79ec..b7e7fa3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v2.0.2 + rev: v2.0.4 hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 From 7c5a12a8e0c5f24f42248d356c031490653333a7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:43:33 +0000 Subject: [PATCH 189/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/add-trailing-comma: v3.0.1 → v3.1.0](https://github.com/asottile/add-trailing-comma/compare/v3.0.1...v3.1.0) - https://github.com/pre-commit/mirrors-autopep8 → https://github.com/hhatto/autopep8 --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b7e7fa3..18ce2e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: reorder-python-imports args: [--py38-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/add-trailing-comma - rev: v3.0.1 + rev: v3.1.0 hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade @@ -27,7 +27,7 @@ repos: hooks: - id: pyupgrade args: [--py38-plus] -- repo: https://github.com/pre-commit/mirrors-autopep8 +- repo: https://github.com/hhatto/autopep8 rev: v2.0.4 hooks: - id: autopep8 From a9f4cab72d99187d574ff7b5cca9095fb110afed Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:56:59 +0000 Subject: [PATCH 190/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.11.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.11.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.11.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.11.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 18ce2e8..77088e2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder-python-imports - rev: v3.10.0 + rev: v3.11.0 hooks: - id: reorder-python-imports args: [--py38-plus, --add-import, 'from __future__ import annotations'] @@ -23,7 +23,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.10.1 + rev: v3.11.0 hooks: - id: pyupgrade args: [--py38-plus] From 7c076dbca12a8ac959ec79aa5d4f03476833e98c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:13:53 +0000 Subject: [PATCH 191/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.11.0 → v3.13.0](https://github.com/asottile/pyupgrade/compare/v3.11.0...v3.13.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 77088e2..3ab2427 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.11.0 + rev: v3.13.0 hooks: - id: pyupgrade args: [--py38-plus] From fc6cde6b7ee466151b0bab6438c800af47ca4180 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:50:02 +0000 Subject: [PATCH 192/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/setup-cfg-fmt: v2.4.0 → v2.5.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.4.0...v2.5.0) - [github.com/asottile/reorder-python-imports: v3.11.0 → v3.12.0](https://github.com/asottile/reorder-python-imports/compare/v3.11.0...v3.12.0) - [github.com/asottile/pyupgrade: v3.13.0 → v3.14.0](https://github.com/asottile/pyupgrade/compare/v3.13.0...v3.14.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3ab2427..6c29123 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,11 +10,11 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.4.0 + rev: v2.5.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder-python-imports - rev: v3.11.0 + rev: v3.12.0 hooks: - id: reorder-python-imports args: [--py38-plus, --add-import, 'from __future__ import annotations'] @@ -23,7 +23,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.13.0 + rev: v3.14.0 hooks: - id: pyupgrade args: [--py38-plus] From f483bf698c323959f638e61234970555aed9d7c2 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 3 Oct 2023 13:13:10 -0400 Subject: [PATCH 193/225] upgrade asottile/workflows Committed via https://github.com/asottile/all-repos --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c6601ce..4b16e57 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,12 +8,12 @@ on: jobs: main-windows: - uses: asottile/workflows/.github/workflows/tox.yml@v1.5.0 + uses: asottile/workflows/.github/workflows/tox.yml@v1.6.0 with: env: '["py38"]' os: windows-latest main-linux: - uses: asottile/workflows/.github/workflows/tox.yml@v1.5.0 + uses: asottile/workflows/.github/workflows/tox.yml@v1.6.0 with: env: '["pypy3", "py38", "py39", "py310", "py311", "py312"]' os: ubuntu-latest From 73035ac54711362af89856e0d98bded3ab982846 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Oct 2023 21:54:30 +0000 Subject: [PATCH 194/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - [github.com/asottile/pyupgrade: v3.14.0 → v3.15.0](https://github.com/asottile/pyupgrade/compare/v3.14.0...v3.15.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6c29123..4a727d6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -23,7 +23,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.14.0 + rev: v3.15.0 hooks: - id: pyupgrade args: [--py38-plus] From 60fd199f26a19f5a04cabe79d7ebbbfb2ec18e32 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 21:12:53 +0000 Subject: [PATCH 195/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.5.1 → v1.6.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.5.1...v1.6.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4a727d6..2cf3ab2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.5.1 + rev: v1.6.0 hooks: - id: mypy exclude: ^testing/ From 3d39e0368336ff22dc22c35492595635ab603a9a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 21:44:47 +0000 Subject: [PATCH 196/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.6.0 → v1.6.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.0...v1.6.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2cf3ab2..ef71447 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.0 + rev: v1.6.1 hooks: - id: mypy exclude: ^testing/ From 90d40abb62635c5e47210dc11385da84fe041c2c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 21:54:30 +0000 Subject: [PATCH 197/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.6.1 → v1.7.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.1...v1.7.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ef71447..7964233 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.1 + rev: v1.7.0 hooks: - id: mypy exclude: ^testing/ From cc2986223633d4aff34bb2f4248f39089909a497 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 21:08:42 +0000 Subject: [PATCH 198/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.7.0 → v1.7.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.7.0...v1.7.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7964233..84c5e84 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.7.0 + rev: v1.7.1 hooks: - id: mypy exclude: ^testing/ From 24d07bddf9387458955f9299940ae54f030276af Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 21:34:45 +0000 Subject: [PATCH 199/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.7.1 → v1.8.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.7.1...v1.8.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 84c5e84..bb63a19 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.7.1 + rev: v1.8.0 hooks: - id: mypy exclude: ^testing/ From be4194407eed7a37047c7c5004937a8600ede515 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 21:34:16 +0000 Subject: [PATCH 200/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 6.1.0 → 7.0.0](https://github.com/PyCQA/flake8/compare/6.1.0...7.0.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bb63a19..07e7c17 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy From d767526267830bfccc0b6c5cc098f375cf67019d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 01:15:53 +0000 Subject: [PATCH 201/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.15.0 → v3.15.1](https://github.com/asottile/pyupgrade/compare/v3.15.0...v3.15.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 07e7c17..054362e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.15.1 hooks: - id: pyupgrade args: [--py38-plus] From 2f99a8d0b8d05ef3f6f1a5c0628c00172ed65775 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 01:28:01 +0000 Subject: [PATCH 202/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.9.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 054362e..434a6f0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.9.0 hooks: - id: mypy exclude: ^testing/ From 7cb39b33ef0437761e820ac21c89f73b09d05a05 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 23:07:25 +0000 Subject: [PATCH 203/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/hhatto/autopep8: v2.0.4 → v2.1.0](https://github.com/hhatto/autopep8/compare/v2.0.4...v2.1.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 434a6f0..7a24bd2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/hhatto/autopep8 - rev: v2.0.4 + rev: v2.1.0 hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 From d1be01f254ddfe609c5d2287642d8dd01284d86d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 22:46:26 +0000 Subject: [PATCH 204/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.15.1 → v3.15.2](https://github.com/asottile/pyupgrade/compare/v3.15.1...v3.15.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7a24bd2..799961e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.15.1 + rev: v3.15.2 hooks: - id: pyupgrade args: [--py38-plus] From dea816a7ea13f9303515a79175bf248a9756cdc3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 23:36:28 +0000 Subject: [PATCH 205/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 799961e..80b69f1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer From c301c3703441173f9d4c7f75870fba2451afd4c2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 23:29:22 +0000 Subject: [PATCH 206/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.9.0...v1.10.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 80b69f1..064a132 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.9.0 + rev: v1.10.0 hooks: - id: mypy exclude: ^testing/ From 7919320a81a74a63a2677e609029a9b3035c8b49 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 22:54:52 +0000 Subject: [PATCH 207/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/hhatto/autopep8: v2.1.0 → v2.1.1](https://github.com/hhatto/autopep8/compare/v2.1.0...v2.1.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 064a132..4b70267 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/hhatto/autopep8 - rev: v2.1.0 + rev: v2.1.1 hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 From 963508c526c7be5e7bdd6f4c4b98b10ee914b764 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 23:11:28 +0000 Subject: [PATCH 208/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder-python-imports: v3.12.0 → v3.13.0](https://github.com/asottile/reorder-python-imports/compare/v3.12.0...v3.13.0) - [github.com/hhatto/autopep8: v2.1.1 → v2.2.0](https://github.com/hhatto/autopep8/compare/v2.1.1...v2.2.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4b70267..fe39aab 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder-python-imports - rev: v3.12.0 + rev: v3.13.0 hooks: - id: reorder-python-imports args: [--py38-plus, --add-import, 'from __future__ import annotations'] @@ -28,7 +28,7 @@ repos: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/hhatto/autopep8 - rev: v2.1.1 + rev: v2.2.0 hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 From 23aaeb2a66f368633eb9769d60c718ca5d4d32dd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 23:28:07 +0000 Subject: [PATCH 209/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fe39aab..2640a9f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.15.2 + rev: v3.16.0 hooks: - id: pyupgrade args: [--py38-plus] From 05415d84490fe220066daffdae00720a8bc0c896 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 23:31:58 +0000 Subject: [PATCH 210/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.0](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/7.0.0...7.1.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2640a9f..ab2601f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,11 +28,11 @@ repos: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/hhatto/autopep8 - rev: v2.2.0 + rev: v2.3.0 hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 + rev: 7.1.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy From 959758d2f84496389b40216ff1693f2c1c4845b3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 23:17:29 +0000 Subject: [PATCH 211/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/hhatto/autopep8: v2.3.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.3.0...v2.3.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ab2601f..568a743 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/hhatto/autopep8 - rev: v2.3.0 + rev: v2.3.1 hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 From 980c68f16f2be50a9c9dcd60670a30fee3ed5dd1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 01:30:26 +0000 Subject: [PATCH 212/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.10.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.0...v1.10.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 568a743..08be327 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.0 + rev: v1.10.1 hooks: - id: mypy exclude: ^testing/ From e6ad4c854b0601e1c48d6990082ff03fe06ae820 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 23:32:06 +0000 Subject: [PATCH 213/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.10.1 → v1.11.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.1...v1.11.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 08be327..6a64172 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.1 + rev: v1.11.0 hooks: - id: mypy exclude: ^testing/ From ab52bb7f869c3d8258f93fd5e8828a380f875294 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 28 Jul 2024 14:41:08 -0400 Subject: [PATCH 214/225] adjust onerror callback signature --- setuptools_golang.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index 5570ffe..af23e4d 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -28,10 +28,11 @@ def rmtree(path: str) -> None: def handle_remove_readonly( func: Callable[..., Any], path: str, - exc: tuple[type[OSError], OSError, TracebackType], + exc: tuple[type[BaseException], BaseException, TracebackType], ) -> None: excvalue = exc[1] if ( + isinstance(excvalue, OSError) and func in (os.rmdir, os.remove, os.unlink) and excvalue.errno == errno.EACCES ): From a098da90fdf04d3ef68ce32301cdaf7029f532c3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 23:24:32 +0000 Subject: [PATCH 215/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.16.0 → v3.17.0](https://github.com/asottile/pyupgrade/compare/v3.16.0...v3.17.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6a64172..e0be276 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.16.0 + rev: v3.17.0 hooks: - id: pyupgrade args: [--py38-plus] From 91ea74ea39d6a696c2f0d1cfc5edfd337c0308a6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 23:26:32 +0000 Subject: [PATCH 216/225] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setuptools_golang.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools_golang.py b/setuptools_golang.py index af23e4d..ced8fca 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -45,7 +45,7 @@ def handle_remove_readonly( @contextlib.contextmanager -def _tmpdir() -> Generator[str, None, None]: +def _tmpdir() -> Generator[str]: tempdir = tempfile.mkdtemp() try: yield tempdir From d1d05e86ce71726cc9d4a094859d2531c288c837 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 00:20:24 +0000 Subject: [PATCH 217/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 7.1.0 → 7.1.1](https://github.com/PyCQA/flake8/compare/7.1.0...7.1.1) - [github.com/pre-commit/mirrors-mypy: v1.11.0 → v1.11.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.0...v1.11.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e0be276..74d5fee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,11 +32,11 @@ repos: hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 - rev: 7.1.0 + rev: 7.1.1 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.0 + rev: v1.11.1 hooks: - id: mypy exclude: ^testing/ From 3cfb9cd356780e05ca19b97ac16c24128c94a7ab Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 23:50:20 +0000 Subject: [PATCH 218/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.11.1 → v1.11.2](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.1...v1.11.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 74d5fee..71b8135 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.1 + rev: v1.11.2 hooks: - id: mypy exclude: ^testing/ From a1b5eb7c8ba31ed7a5558a480f0a009fed1e14fd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 01:45:58 +0000 Subject: [PATCH 219/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 71b8135..cc311d6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer From 52f3ae80e60cd91f25b382cb4018f953f364128a Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 11 Oct 2024 19:23:59 -0400 Subject: [PATCH 220/225] py39+ Committed via https://github.com/asottile/all-repos --- .github/workflows/main.yml | 8 ++++---- .pre-commit-config.yaml | 4 ++-- setup.cfg | 2 +- setuptools_golang.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b16e57..fabc8af 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,12 +8,12 @@ on: jobs: main-windows: - uses: asottile/workflows/.github/workflows/tox.yml@v1.6.0 + uses: asottile/workflows/.github/workflows/tox.yml@v1.7.0 with: - env: '["py38"]' + env: '["py39"]' os: windows-latest main-linux: - uses: asottile/workflows/.github/workflows/tox.yml@v1.6.0 + uses: asottile/workflows/.github/workflows/tox.yml@v1.7.0 with: - env: '["pypy3", "py38", "py39", "py310", "py311", "py312"]' + env: '["pypy3", "py39", "py310", "py311", "py312", "py313"]' os: ubuntu-latest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cc311d6..daab115 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: rev: v3.13.0 hooks: - id: reorder-python-imports - args: [--py38-plus, --add-import, 'from __future__ import annotations'] + args: [--py39-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/add-trailing-comma rev: v3.1.0 hooks: @@ -26,7 +26,7 @@ repos: rev: v3.17.0 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/hhatto/autopep8 rev: v2.3.1 hooks: diff --git a/setup.cfg b/setup.cfg index 47dc4fa..adde60a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ classifiers = py_modules = setuptools_golang install_requires = setuptools -python_requires = >=3.8 +python_requires = >=3.9 [options.entry_points] console_scripts = diff --git a/setuptools_golang.py b/setuptools_golang.py index ced8fca..e26543d 100644 --- a/setuptools_golang.py +++ b/setuptools_golang.py @@ -11,11 +11,11 @@ import subprocess import sys import tempfile +from collections.abc import Generator +from collections.abc import Sequence from types import TracebackType from typing import Any from typing import Callable -from typing import Generator -from typing import Sequence from distutils.ccompiler import CCompiler from distutils.dist import Distribution From 61bd9d3012bd1c27fd87497f3b683834179d9105 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 00:06:26 +0000 Subject: [PATCH 221/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/setup-cfg-fmt: v2.5.0 → v2.7.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.5.0...v2.7.0) - [github.com/asottile/reorder-python-imports: v3.13.0 → v3.14.0](https://github.com/asottile/reorder-python-imports/compare/v3.13.0...v3.14.0) - [github.com/asottile/pyupgrade: v3.17.0 → v3.18.0](https://github.com/asottile/pyupgrade/compare/v3.17.0...v3.18.0) - [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.12.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.2...v1.12.1) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index daab115..6e8d74b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,11 +10,11 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.5.0 + rev: v2.7.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/asottile/reorder-python-imports - rev: v3.13.0 + rev: v3.14.0 hooks: - id: reorder-python-imports args: [--py39-plus, --add-import, 'from __future__ import annotations'] @@ -23,7 +23,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 + rev: v3.18.0 hooks: - id: pyupgrade args: [--py39-plus] @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 + rev: v1.12.1 hooks: - id: mypy exclude: ^testing/ From 624ee9360e4b106e32f2b143870d9f69fb97f879 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 00:35:01 +0000 Subject: [PATCH 222/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.18.0 → v3.19.0](https://github.com/asottile/pyupgrade/compare/v3.18.0...v3.19.0) - [github.com/pre-commit/mirrors-mypy: v1.12.1 → v1.13.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.12.1...v1.13.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6e8d74b..9f689da 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.18.0 + rev: v3.19.0 hooks: - id: pyupgrade args: [--py39-plus] @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.12.1 + rev: v1.13.0 hooks: - id: mypy exclude: ^testing/ From 03acf7bcd8ebc685e103106c4c80e6460fd1cb22 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 00:24:36 +0000 Subject: [PATCH 223/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.19.0 → v3.19.1](https://github.com/asottile/pyupgrade/compare/v3.19.0...v3.19.1) - [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.13.0...v1.14.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f689da..7af8844 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.19.0 + rev: v3.19.1 hooks: - id: pyupgrade args: [--py39-plus] @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.14.0 hooks: - id: mypy exclude: ^testing/ From cefb6249b4c975b71efc32805a6b664add3992f0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 01:43:44 +0000 Subject: [PATCH 224/225] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.14.0 → v1.14.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.14.0...v1.14.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7af8844..061fab0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.14.0 + rev: v1.14.1 hooks: - id: mypy exclude: ^testing/ From 7118668a94106b243801cb23b0ab50f1947176e7 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 20 Jan 2025 15:41:50 -0500 Subject: [PATCH 225/225] add deprecation message --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index ab855d0..6ed218b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ +# DEPRECATED + +it turns out multiple go shared objects in a single process is not supported + +it likely broke in [go 1.21] and there is no intention to fix it :( + +[go 1.21]: https://github.com/golang/go/issues/65050#issue-2074509727 + +___ + [![build status](https://github.com/asottile/setuptools-golang/actions/workflows/main.yml/badge.svg)](https://github.com/asottile/setuptools-golang/actions/workflows/main.yml) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/setuptools-golang/main.svg)](https://results.pre-commit.ci/latest/github/asottile/setuptools-golang/main)