diff --git a/appveyor.yml b/.appveyor.yml similarity index 81% rename from appveyor.yml rename to .appveyor.yml index 2854a90..0ae9abb 100644 --- a/appveyor.yml +++ b/.appveyor.yml @@ -1,128 +1,125 @@ version: '{branch}-{build}' build: off -cache: - - '%LOCALAPPDATA%\pip\Cache' environment: global: - TWINE_PASSWORD: - secure: fDwCnDhQiptm9a4ZcFpgyQ== TWINE_USERNAME: ionel - WITH_COMPILER: 'cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd' + COVERALLS_EXTRAS: '-v' + COVERALLS_REPO_TOKEN: 6picUzuGNWKI5w3rsEyZGNvyMZ47Cz9hZ matrix: - TOXENV: check TOXPYTHON: C:\Python36\python.exe PYTHON_HOME: C:\Python36 PYTHON_VERSION: '3.6' PYTHON_ARCH: '32' - - TOXENV: 'py27-cover,report,codecov' + - TOXENV: py27-cover,codecov,coveralls TOXPYTHON: C:\Python27\python.exe PYTHON_HOME: C:\Python27 PYTHON_VERSION: '2.7' PYTHON_ARCH: '32' - - TOXENV: 'py27-cover,report,codecov' + - TOXENV: py27-cover,codecov,coveralls TOXPYTHON: C:\Python27-x64\python.exe - WINDOWS_SDK_VERSION: v7.0 PYTHON_HOME: C:\Python27-x64 PYTHON_VERSION: '2.7' PYTHON_ARCH: '64' - - TOXENV: 'py27-nocov' + WINDOWS_SDK_VERSION: v7.0 + - TOXENV: py27-nocov TOXPYTHON: C:\Python27\python.exe PYTHON_HOME: C:\Python27 PYTHON_VERSION: '2.7' PYTHON_ARCH: '32' WHEEL_PATH: .tox/dist - - TOXENV: 'py27-nocov' + - TOXENV: py27-nocov TOXPYTHON: C:\Python27-x64\python.exe - WINDOWS_SDK_VERSION: v7.0 PYTHON_HOME: C:\Python27-x64 PYTHON_VERSION: '2.7' PYTHON_ARCH: '64' WHEEL_PATH: .tox/dist - - TOXENV: 'py34-cover,report,codecov' + WINDOWS_SDK_VERSION: v7.0 + - TOXENV: py34-cover,codecov,coveralls TOXPYTHON: C:\Python34\python.exe PYTHON_HOME: C:\Python34 PYTHON_VERSION: '3.4' PYTHON_ARCH: '32' - - TOXENV: 'py34-cover,report,codecov' + - TOXENV: py34-cover,codecov,coveralls TOXPYTHON: C:\Python34-x64\python.exe - WINDOWS_SDK_VERSION: v7.1 PYTHON_HOME: C:\Python34-x64 PYTHON_VERSION: '3.4' PYTHON_ARCH: '64' - - TOXENV: 'py34-nocov' + WINDOWS_SDK_VERSION: v7.1 + - TOXENV: py34-nocov TOXPYTHON: C:\Python34\python.exe PYTHON_HOME: C:\Python34 PYTHON_VERSION: '3.4' PYTHON_ARCH: '32' WHEEL_PATH: .tox/dist - - TOXENV: 'py34-nocov' + - TOXENV: py34-nocov TOXPYTHON: C:\Python34-x64\python.exe - WINDOWS_SDK_VERSION: v7.1 PYTHON_HOME: C:\Python34-x64 PYTHON_VERSION: '3.4' PYTHON_ARCH: '64' WHEEL_PATH: .tox/dist - - TOXENV: 'py35-cover,report,codecov' + WINDOWS_SDK_VERSION: v7.1 + - TOXENV: py35-cover,codecov,coveralls TOXPYTHON: C:\Python35\python.exe PYTHON_HOME: C:\Python35 PYTHON_VERSION: '3.5' PYTHON_ARCH: '32' - - TOXENV: 'py35-cover,report,codecov' + - TOXENV: py35-cover,codecov,coveralls TOXPYTHON: C:\Python35-x64\python.exe PYTHON_HOME: C:\Python35-x64 PYTHON_VERSION: '3.5' PYTHON_ARCH: '64' - - TOXENV: 'py35-nocov' + - TOXENV: py35-nocov TOXPYTHON: C:\Python35\python.exe PYTHON_HOME: C:\Python35 PYTHON_VERSION: '3.5' PYTHON_ARCH: '32' WHEEL_PATH: .tox/dist - - TOXENV: 'py35-nocov' + - TOXENV: py35-nocov TOXPYTHON: C:\Python35-x64\python.exe PYTHON_HOME: C:\Python35-x64 PYTHON_VERSION: '3.5' PYTHON_ARCH: '64' WHEEL_PATH: .tox/dist - - TOXENV: 'py36-cover,report,codecov' + - TOXENV: py36-cover,codecov,coveralls TOXPYTHON: C:\Python36\python.exe PYTHON_HOME: C:\Python36 PYTHON_VERSION: '3.6' PYTHON_ARCH: '32' - - TOXENV: 'py36-cover,report,codecov' + - TOXENV: py36-cover,codecov,coveralls TOXPYTHON: C:\Python36-x64\python.exe PYTHON_HOME: C:\Python36-x64 PYTHON_VERSION: '3.6' PYTHON_ARCH: '64' - - TOXENV: 'py36-nocov' + - TOXENV: py36-nocov TOXPYTHON: C:\Python36\python.exe PYTHON_HOME: C:\Python36 PYTHON_VERSION: '3.6' PYTHON_ARCH: '32' WHEEL_PATH: .tox/dist - - TOXENV: 'py36-nocov' + - TOXENV: py36-nocov TOXPYTHON: C:\Python36-x64\python.exe PYTHON_HOME: C:\Python36-x64 PYTHON_VERSION: '3.6' PYTHON_ARCH: '64' WHEEL_PATH: .tox/dist - - TOXENV: 'py37-cover,report,codecov' + - TOXENV: py37-cover,codecov,coveralls TOXPYTHON: C:\Python37\python.exe PYTHON_HOME: C:\Python37 PYTHON_VERSION: '3.7' PYTHON_ARCH: '32' - - TOXENV: 'py37-cover,report,codecov' + - TOXENV: py37-cover,codecov,coveralls TOXPYTHON: C:\Python37-x64\python.exe PYTHON_HOME: C:\Python37-x64 PYTHON_VERSION: '3.7' PYTHON_ARCH: '64' - - TOXENV: 'py37-nocov' + - TOXENV: py37-nocov TOXPYTHON: C:\Python37\python.exe PYTHON_HOME: C:\Python37 PYTHON_VERSION: '3.7' PYTHON_ARCH: '32' WHEEL_PATH: .tox/dist - - TOXENV: 'py37-nocov' + - TOXENV: py37-nocov TOXPYTHON: C:\Python37-x64\python.exe PYTHON_HOME: C:\Python37-x64 PYTHON_VERSION: '3.7' @@ -132,22 +129,19 @@ init: - ps: echo $env:TOXENV - ps: ls C:\Python* install: - - python -u ci\appveyor-bootstrap.py + - '%PYTHON_HOME%\python -mpip install --progress-bar=off --verbose twine tox-wheel -rci/requirements.txt' - '%PYTHON_HOME%\Scripts\virtualenv --version' - '%PYTHON_HOME%\Scripts\easy_install --version' - '%PYTHON_HOME%\Scripts\pip --version' - '%PYTHON_HOME%\Scripts\tox --version' test_script: - cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd %PYTHON_HOME%\Scripts\tox +on_success: + - IF DEFINED WHEEL_PATH %PYTHON_HOME%\Scripts\twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing %WHEEL_PATH%/*.whl on_failure: - ps: dir "env:" - ps: get-content .tox\*\log\* -on_success: - - IF DEFINED WHEEL_PATH %PYTHON_HOME%\Scripts\twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing %WHEEL_PATH%/*.whl - -artifacts: - - path: dist\* ### To enable remote debugging uncomment this (also, see: http://www.appveyor.com/docs/how-to/rdp-to-build-worker): # on_finish: diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 63a0494..8874d57 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.4.1 +current_version = 1.4.2 commit = True tag = True diff --git a/.cookiecutterrc b/.cookiecutterrc index 23a1e8c..cd17391 100644 --- a/.cookiecutterrc +++ b/.cookiecutterrc @@ -3,32 +3,39 @@ cookiecutter: _extensions: - jinja2_time.TimeExtension - _template: cookiecutter-pylibrary + _template: /home/ionel/open-source/cookiecutter-pylibrary appveyor: yes - c_extension_function: stuff - c_extension_module: cext + c_extension_function: '-' + c_extension_module: '-' c_extension_optional: yes c_extension_support: yes + c_extension_test_pypi: yes + c_extension_test_pypi_username: ionel codacy: no + codacy_projectid: 862e7946eabb4112be6503a667381b71 codeclimate: no codecov: yes command_line_interface: no command_line_interface_bin_name: '-' coveralls: yes + coveralls_token: 6picUzuGNWKI5w3rsEyZGNvyMZ47Cz9hZ distribution_name: lazy-object-proxy email: contact@ionelmc.ro full_name: Ionel Cristian Mărieș - github_username: ionelmc landscape: no license: BSD 2-Clause License linter: flake8 package_name: lazy_object_proxy project_name: lazy-object-proxy project_short_description: A fast and thorough lazy object proxy. - release_date: '2017-05-05' + release_date: '2019-05-10' + repo_hosting: github repo_name: python-lazy-object-proxy + repo_username: ionelmc requiresio: yes scrutinizer: no + setup_py_uses_setuptools_scm: yes + setup_py_uses_test_runner: no sphinx_docs: yes sphinx_doctest: no sphinx_theme: sphinx-py3doc-enhanced-theme @@ -36,7 +43,8 @@ cookiecutter: test_matrix_separate_coverage: yes test_runner: pytest travis: yes - version: 1.3.1 + travis_osx: yes + version: 1.4.1 website: https://blog.ionelmc.ro year_from: '2014' year_to: '2019' diff --git a/.gitignore b/.gitignore index 9518522..f90d902 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ lib lib64 venv*/ pyvenv*/ +pip-wheel-metadata/ # Installer logs pip-log.txt diff --git a/.travis.yml b/.travis.yml index 22898c9..6938091 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,11 @@ language: python dist: xenial +cache: false env: global: - LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so - SEGFAULT_SIGNALS=all + - TWINE_USERNAME=ionel matrix: include: - python: '3.6' @@ -12,9 +14,6 @@ matrix: - python: '3.6' env: - TOXENV=docs - - python: '2.7' - env: - - TOXENV=py27-cover,report,extension-coveralls,coveralls,codecov - os: osx language: generic cache: @@ -23,11 +22,9 @@ matrix: - $HOME/Library/Caches/pip env: - TOXENV=py27-cover - - python: '2.7' - env: - - TOXENV=py27-nocov - - WHEEL_MANYLINUX1=cp27 - - WHEEL_PATH=wheelhouse + - env: + - TOXENV=py27-cover,codecov,extension-coveralls,coveralls + python: '2.7' - os: osx language: generic cache: @@ -37,34 +34,35 @@ matrix: env: - TOXENV=py27-nocov - WHEEL_PATH=.tox/dist - - python: '3.4' - env: - - TOXENV=py34-cover,report,extension-coveralls,coveralls,codecov - - python: '3.4' - env: + - env: + - TOXENV=py27-nocov + - WHEEL_MANYLINUX1=cp27 + - WHEEL_PATH=wheelhouse + python: '2.7' + - env: + - TOXENV=py34-cover,codecov,extension-coveralls,coveralls + python: '3.4' + - env: - TOXENV=py34-nocov - WHEEL_MANYLINUX1=cp34 - WHEEL_PATH=wheelhouse - - python: '3.5' - env: - - TOXENV=py35-cover,report,extension-coveralls,coveralls,codecov - - python: '3.5' - env: + python: '3.4' + - env: + - TOXENV=py35-cover,codecov,extension-coveralls,coveralls + python: '3.5' + - env: - TOXENV=py35-nocov - WHEEL_MANYLINUX1=cp35 - WHEEL_PATH=wheelhouse - - python: '3.6' - env: - - TOXENV=py36-cover,report,extension-coveralls,coveralls,codecov - - python: '3.6' - env: + python: '3.5' + - env: + - TOXENV=py36-cover,codecov,extension-coveralls,coveralls + python: '3.6' + - env: - TOXENV=py36-nocov - WHEEL_MANYLINUX1=cp36 - WHEEL_PATH=wheelhouse - - python: '3.7' - env: - - TOXENV=py37-cover,report,extension-coveralls,coveralls,codecov - dist: xenial + python: '3.6' - os: osx language: generic cache: @@ -73,12 +71,9 @@ matrix: - $HOME/Library/Caches/pip env: - TOXENV=py37-cover - - python: '3.7' - env: - - TOXENV=py37-nocov - - WHEEL_MANYLINUX1=cp37 - - WHEEL_PATH=wheelhouse - dist: xenial + - env: + - TOXENV=py37-cover,codecov,extension-coveralls,coveralls + python: '3.7' - os: osx language: generic cache: @@ -88,18 +83,25 @@ matrix: env: - TOXENV=py37-nocov - WHEEL_PATH=.tox/dist - - python: 'pypy2.7-6.0' - env: - - TOXENV=pypy-cover,report,extension-coveralls,coveralls,codecov - - python: 'pypy2.7-6.0' - env: + - env: + - TOXENV=py37-nocov + - WHEEL_MANYLINUX1=cp37 + - WHEEL_PATH=wheelhouse + python: '3.7' + - env: + - TOXENV=pypy-cover,codecov,extension-coveralls,coveralls + python: 'pypy2.7-6.0' + - env: - TOXENV=pypy-nocov - - python: 'pypy3.5-6.0' - env: - - TOXENV=pypy3-cover,report,extension-coveralls,coveralls,codecov - - python: 'pypy3.5-6.0' - env: + python: 'pypy2.7-6.0' + - env: + - TOXENV=pypy3-cover,codecov,extension-coveralls,coveralls + - TOXPYTHON=pypy3 + python: 'pypy3.5-6.0' + - env: - TOXENV=pypy3-nocov + - TOXPYTHON=pypy3 + python: 'pypy3.5-6.0' before_install: - python --version - uname -a @@ -111,7 +113,7 @@ before_install: export PATH="/usr/local/opt/python/libexec/bin:${PATH}" fi install: - - pip install twine tox-wheel + - python -mpip install --progress-bar=off --verbose twine tox-wheel -rci/requirements.txt - virtualenv --version - easy_install --version - pip --version diff --git a/README.rst b/README.rst index 6ee0629..a46ded8 100644 --- a/README.rst +++ b/README.rst @@ -43,9 +43,9 @@ Overview :alt: PyPI Package latest release :target: https://pypi.org/project/lazy-object-proxy -.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-lazy-object-proxy/v1.4.1.svg +.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-lazy-object-proxy/v1.4.2.svg :alt: Commits since latest release - :target: https://github.com/ionelmc/python-lazy-object-proxy/compare/v1.4.1...master + :target: https://github.com/ionelmc/python-lazy-object-proxy/compare/v1.4.2...master .. |wheel| image:: https://img.shields.io/pypi/wheel/lazy-object-proxy.svg :alt: PyPI Wheel diff --git a/ci/appveyor-bootstrap.py b/ci/appveyor-bootstrap.py deleted file mode 100644 index 880e0e8..0000000 --- a/ci/appveyor-bootstrap.py +++ /dev/null @@ -1,117 +0,0 @@ -""" -AppVeyor will at least have few Pythons around so there"s no point of implementing a bootstrapper in PowerShell. - -This is a port of https://github.com/pypa/python-packaging-user-guide/blob/master/source/code/install.ps1 -with various fixes and improvements that just weren"t feasible to implement in PowerShell. -""" -from __future__ import print_function - -from os import environ -from os.path import exists -from subprocess import check_call - -try: - from urllib.request import urlretrieve -except ImportError: - from urllib import urlretrieve - -BASE_URL = "https://www.python.org/ftp/python/" -GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" -GET_PIP_PATH = "C:\get-pip.py" -URLS = { - ("2.7", "64"): BASE_URL + "2.7.13/python-2.7.13.amd64.msi", - ("2.7", "32"): BASE_URL + "2.7.13/python-2.7.13.msi", - ("3.4", "64"): BASE_URL + "3.4.4/python-3.4.4.amd64.msi", - ("3.4", "32"): BASE_URL + "3.4.4/python-3.4.4.msi", - ("3.5", "64"): BASE_URL + "3.5.4/python-3.5.4-amd64.exe", - ("3.5", "32"): BASE_URL + "3.5.4/python-3.5.4.exe", - ("3.6", "64"): BASE_URL + "3.6.2/python-3.6.2-amd64.exe", - ("3.6", "32"): BASE_URL + "3.6.2/python-3.6.2.exe", -} -INSTALL_CMD = { - # Commands are allowed to fail only if they are not the last command. Eg: uninstall (/x) allowed to fail. - "2.7": [["msiexec.exe", "/L*+!", "install.log", "/qn", "/x", "{path}"], - ["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}", "TARGETDIR={home}"]], - "3.4": [["msiexec.exe", "/L*+!", "install.log", "/qn", "/x", "{path}"], - ["msiexec.exe", "/L*+!", "install.log", "/qn", "/i", "{path}", "TARGETDIR={home}"]], - "3.5": [["{path}", "/quiet", "TargetDir={home}"]], - "3.6": [["{path}", "/quiet", "TargetDir={home}"]], -} - - -def verbose_check_call(cmd): - print("Running:", cmd) - check_call(cmd) - - -def download_file(url, path): - print("Downloading: {} (into {})".format(url, path)) - progress = [0, 0] - - def report(count, size, total): - progress[0] = count * size - if progress[0] - progress[1] > 1000000: - progress[1] = progress[0] - print("Downloaded {:,}/{:,} ...".format(progress[1], total)) - - dest, _ = urlretrieve(url, path, reporthook=report) - return dest - - -def install_python(version, arch, home): - print("Installing Python", version, "for", arch, "bit architecture to", home) - if exists(home): - return - - path = download_python(version, arch) - print("Installing", path, "to", home) - success = False - for cmd in INSTALL_CMD[version]: - cmd = [part.format(home=home, path=path) for part in cmd] - try: - verbose_check_call(cmd) - except Exception as exc: - print("Failed command", cmd, "with:", exc) - if exists("install.log"): - with open("install.log") as fh: - print(fh.read()) - else: - success = True - if success: - print("Installation complete!") - else: - print("Installation failed") - - -def download_python(version, arch): - for _ in range(3): - try: - return download_file(URLS[version, arch], "installer.exe") - except Exception as exc: - print("Failed to download:", exc) - print("Retrying ...") - - -def install_pip(home): - pip_path = home + "/Scripts/pip.exe" - python_path = home + "/python.exe" - if exists(pip_path): - print("Upgrading pip...") - verbose_check_call([python_path, "-mpip", "install", "--upgrade", "pip", "setuptools"]) - else: - print("Installing pip...") - download_file(GET_PIP_URL, GET_PIP_PATH) - verbose_check_call([python_path, GET_PIP_PATH]) - - -def install_packages(home, *packages): - cmd = [home + "/Scripts/pip.exe", "install"] - cmd.extend(packages) - verbose_check_call(cmd) - - -if __name__ == "__main__": - install_python(environ["PYTHON_VERSION"], environ["PYTHON_ARCH"], environ["PYTHON_HOME"]) - install_pip(environ["PYTHON_HOME"]) - install_packages(environ["PYTHON_HOME"], "--upgrade", "pip") - install_packages(environ["PYTHON_HOME"], "--upgrade", "tox-wheel", "twine") diff --git a/ci/bootstrap.py b/ci/bootstrap.py index e64a6c0..0dea566 100755 --- a/ci/bootstrap.py +++ b/ci/bootstrap.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from __future__ import absolute_import, print_function, unicode_literals +from __future__ import absolute_import +from __future__ import print_function +from __future__ import unicode_literals import os import sys @@ -8,6 +10,13 @@ from os.path import dirname from os.path import exists from os.path import join +from os.path import normpath + +try: + from os.path import samefile +except ImportError: + def samefile(a, b): + return normpath(abspath(a)) == normpath(abspath(b)) if __name__ == "__main__": @@ -29,7 +38,9 @@ print("Installing `jinja2` into bootstrap environment...") subprocess.check_call([join(bin_path, "pip"), "install", "jinja2"]) python_executable = join(bin_path, "python") - if not os.path.samefile(python_executable, sys.executable): + if not os.path.exists(python_executable): + python_executable += '.exe' + if not samefile(python_executable, sys.executable): print("Re-executing with: {0}".format(python_executable)) os.execv(python_executable, [python_executable, __file__]) @@ -46,10 +57,14 @@ tox_environments = [ line.strip() - # WARNING: 'tox' must be installed globally or in the project's virtualenv - for line in subprocess.check_output(['tox', '--listenvs'], universal_newlines=True).splitlines() + # 'tox' need not be installed globally, but must be importable + # by the Python that is running this script. + # This uses sys.executable the same way that the call in + # cookiecutter-pylibrary/hooks/post_gen_project.py + # invokes this bootstrap.py itself. + for line in subprocess.check_output([sys.executable, '-m', 'tox', '--listenvs'], universal_newlines=True).splitlines() ] - tox_environments = [line for line in tox_environments if line not in ['clean', 'report', 'docs', 'check']] + tox_environments = [line for line in tox_environments if line.startswith('py')] for name in os.listdir(join("ci", "templates")): with open(join(base_path, name), "w") as fh: diff --git a/ci/requirements.txt b/ci/requirements.txt new file mode 100644 index 0000000..1c8d385 --- /dev/null +++ b/ci/requirements.txt @@ -0,0 +1,3 @@ +virtualenv>=16.6.0 +pip>=19.1.1 +setuptools>=18.0.1 diff --git a/ci/templates/appveyor.yml b/ci/templates/.appveyor.yml similarity index 71% rename from ci/templates/appveyor.yml rename to ci/templates/.appveyor.yml index 120b8bb..22f9e0a 100644 --- a/ci/templates/appveyor.yml +++ b/ci/templates/.appveyor.yml @@ -1,61 +1,57 @@ version: '{branch}-{build}' build: off -cache: - - '%LOCALAPPDATA%\pip\Cache' environment: global: - TWINE_PASSWORD: - secure: fDwCnDhQiptm9a4ZcFpgyQ== TWINE_USERNAME: ionel - WITH_COMPILER: 'cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd' + COVERALLS_EXTRAS: '-v' + COVERALLS_REPO_TOKEN: 6picUzuGNWKI5w3rsEyZGNvyMZ47Cz9hZ matrix: - TOXENV: check TOXPYTHON: C:\Python36\python.exe PYTHON_HOME: C:\Python36 PYTHON_VERSION: '3.6' PYTHON_ARCH: '32' -{% for env in tox_environments %}{{ '' }}{% if env.startswith(('py2', 'py3')) %} - - TOXENV: '{{ env }}{% if env.endswith('-cover') %},report,codecov{% endif %}' +{% for env in tox_environments %} +{% if env.startswith(('py2', 'py3')) %} + - TOXENV: {{ env }}{% if env.endswith('-cover') %},codecov,coveralls{% endif %} + TOXPYTHON: C:\Python{{ env[2:4] }}\python.exe PYTHON_HOME: C:\Python{{ env[2:4] }} PYTHON_VERSION: '{{ env[2] }}.{{ env[3] }}' PYTHON_ARCH: '32' -{% if "nocov" in env %} +{% if 'nocov' in env %} WHEEL_PATH: .tox/dist {% endif %} - - TOXENV: '{{ env }}{% if env.endswith('-cover') %},report,codecov{% endif %}' - TOXPYTHON: C:\Python{{ env[2:4] }}-x64\python.exe - {%- if env.startswith(('py2', 'py34')) %} - - WINDOWS_SDK_VERSION: v7.{{ '1' if env.startswith('py3') else '0' }} - {%- endif %} + - TOXENV: {{ env }}{% if env.endswith('-cover') %},codecov,coveralls{% endif %} + TOXPYTHON: C:\Python{{ env[2:4] }}-x64\python.exe PYTHON_HOME: C:\Python{{ env[2:4] }}-x64 PYTHON_VERSION: '{{ env[2] }}.{{ env[3] }}' PYTHON_ARCH: '64' -{% if "nocov" in env %} +{% if 'nocov' in env %} WHEEL_PATH: .tox/dist -{% endif %}{% endif %}{% endfor %} +{% endif %} +{% if env.startswith(('py2', 'py34')) %} + WINDOWS_SDK_VERSION: v7.{{ '1' if env.startswith('py3') else '0' }} +{% endif %} +{% endif %}{% endfor %} init: - ps: echo $env:TOXENV - ps: ls C:\Python* install: - - python -u ci\appveyor-bootstrap.py + - '%PYTHON_HOME%\python -mpip install --progress-bar=off --verbose twine tox-wheel -rci/requirements.txt' - '%PYTHON_HOME%\Scripts\virtualenv --version' - '%PYTHON_HOME%\Scripts\easy_install --version' - '%PYTHON_HOME%\Scripts\pip --version' - '%PYTHON_HOME%\Scripts\tox --version' test_script: - cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd %PYTHON_HOME%\Scripts\tox +on_success: + - IF DEFINED WHEEL_PATH %PYTHON_HOME%\Scripts\twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing %WHEEL_PATH%/*.whl on_failure: - ps: dir "env:" - ps: get-content .tox\*\log\* -on_success: - - IF DEFINED WHEEL_PATH %PYTHON_HOME%\Scripts\twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing %WHEEL_PATH%/*.whl - -artifacts: - - path: dist\* ### To enable remote debugging uncomment this (also, see: http://www.appveyor.com/docs/how-to/rdp-to-build-worker): # on_finish: diff --git a/ci/templates/.travis.yml b/ci/templates/.travis.yml index 7b31169..0c5a5ab 100644 --- a/ci/templates/.travis.yml +++ b/ci/templates/.travis.yml @@ -1,9 +1,11 @@ language: python dist: xenial +cache: false env: global: - LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so - SEGFAULT_SIGNALS=all + - TWINE_USERNAME=ionel matrix: include: - python: '3.6' @@ -13,23 +15,7 @@ matrix: env: - TOXENV=docs {%- for env in tox_environments %}{{ '' }} -{% if env.startswith("pypy3") %} - - python: 'pypy3.5-6.0' -{% elif env.startswith("pypy") %} - - python: 'pypy2.7-6.0' -{% else %} - - python: '{{ "{0[2]}.{0[3]}".format(env) }}' -{% endif %} - env: - - TOXENV={{ env }}{% if 'cover' in env %},report,extension-coveralls,coveralls,codecov{% endif -%} -{%- if "pypy" not in env and "nocov" in env %}{{ '' }} - - WHEEL_MANYLINUX1=cp{{ env.split("-")[0][2:] }} - - WHEEL_PATH=wheelhouse -{%- endif %} -{%- if "py37" in env %}{{ '' }} - dist: xenial -{%- endif %} -{%- if "py37" in env or "py27" in env %}{{ '' }} +{%- if 'py37' in env or 'py27' in env %}{{ '' }} - os: osx language: generic cache: @@ -38,9 +24,23 @@ matrix: - $HOME/Library/Caches/pip env: - TOXENV={{ env }} -{%- if "nocov" in env %}{{ '' }} +{%- if 'nocov' in env %}{{ '' }} - WHEEL_PATH=.tox/dist {%- endif %} +{%- endif %}{{ '' }} + - env: + - TOXENV={{ env }}{% if 'cover' in env %},codecov,extension-coveralls,coveralls{% endif %} +{%- if 'pypy' not in env and 'nocov' in env %}{{ '' }} + - WHEEL_MANYLINUX1=cp{{ env.split('-')[0][2:] }} + - WHEEL_PATH=wheelhouse +{%- endif %} +{%- if env.startswith('pypy3') %}{{ '' }} + - TOXPYTHON=pypy3 + python: 'pypy3.5-6.0' +{%- elif env.startswith('pypy') %}{{ '' }} + python: 'pypy2.7-6.0' +{%- else %}{{ '' }} + python: '{{ '{0[2]}.{0[3]}'.format(env) }}' {%- endif %} {%- endfor %}{{ '' }} before_install: @@ -54,7 +54,7 @@ before_install: export PATH="/usr/local/opt/python/libexec/bin:${PATH}" fi install: - - pip install twine tox-wheel + - python -mpip install --progress-bar=off --verbose twine tox-wheel -rci/requirements.txt - virtualenv --version - easy_install --version - pip --version diff --git a/ci/templates/tox.ini b/ci/templates/tox.ini index da66e12..f0f86b9 100644 --- a/ci/templates/tox.ini +++ b/ci/templates/tox.ini @@ -7,6 +7,7 @@ envlist = docs, {py27,py34,py35,py36,py37,pypy,pypy3}-{cover,nocov}, report +ignore_basepython_conflict = true [testenv] wheel = true @@ -31,7 +32,7 @@ deps = pytest pytest-benchmark pytest-travis-fold - Django + Django==1.11.23 objproxies==0.9.4 cover: pytest-cov commands = @@ -74,6 +75,9 @@ deps = [testenv:docs] deps = -r{toxinidir}/docs/requirements.txt +usedevelop = true +install_command = + python -m pip install --no-use-pep517 {opts} {packages} commands = sphinx-build {posargs:-E} -b html docs dist/docs sphinx-build -b linkcheck docs dist/docs @@ -83,7 +87,7 @@ deps = coveralls skip_install = true commands = - coveralls --merge=extension-coveralls.json [] + coveralls {env:COVERALLS_EXTRAS:--merge=extension-coveralls.json} [] [testenv:extension-coveralls] deps = @@ -97,7 +101,6 @@ deps = codecov skip_install = true commands = - coverage xml --ignore-errors codecov [] [testenv:report] diff --git a/docs/conf.py b/docs/conf.py index ce5eeca..e44312a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,7 +26,7 @@ year = '2014-2019' author = 'Ionel Cristian Mărieș' copyright = '{0}, {1}'.format(year, author) -version = release = '1.4.1' +version = release = '1.4.2' pygments_style = 'trac' templates_path = ['.'] diff --git a/docs/requirements.txt b/docs/requirements.txt index ef4a013..62bc14e 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,2 @@ sphinx>=1.3 sphinx-py3doc-enhanced-theme --e . diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0e3b770 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[build-system] +requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm>=3.3.1"] diff --git a/setup.cfg b/setup.cfg index ac1828f..4868ee5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,6 +7,10 @@ max-line-length = 140 exclude = */migrations/* [tool:pytest] +# If a pytest section is found in one of the possible config files +# (pytest.ini, tox.ini or setup.cfg), then pytest will not look for any others, +# so if you add a pytest config section elsewhere, +# you will need to delete this section from setup.cfg. norecursedirs = .git .tox @@ -33,7 +37,7 @@ addopts = --doctest-glob=\*.rst --tb=short -[isort] +[tool:isort] force_single_line = True line_length = 120 known_first_party = lazy_object_proxy diff --git a/setup.py b/setup.py index 0c223f7..d1d379a 100644 --- a/setup.py +++ b/setup.py @@ -63,7 +63,7 @@ def _unavailable(self, e): use_scm_version={ 'local_scheme': 'dirty-tag', 'write_to': 'src/lazy_object_proxy/_version.py', - 'fallback_version': '1.4.1', + 'fallback_version': '1.4.2', }, license='BSD 2-Clause License', description='A fast and thorough lazy object proxy.', diff --git a/src/lazy_object_proxy/__init__.py b/src/lazy_object_proxy/__init__.py index 35ce3c4..25b1434 100644 --- a/src/lazy_object_proxy/__init__.py +++ b/src/lazy_object_proxy/__init__.py @@ -18,6 +18,6 @@ try: from ._version import version as __version__ except ImportError: - __version__ = '1.4.1' + __version__ = '1.4.2' __all__ = "Proxy", diff --git a/tox.ini b/tox.ini index 1dd2012..9fbc292 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ envlist = docs, {py27,py34,py35,py36,py37,pypy,pypy3}-{cover,nocov}, report +ignore_basepython_conflict = true [testenv] wheel = true @@ -31,7 +32,7 @@ deps = pytest pytest-benchmark pytest-travis-fold - Django + Django==1.11.23 objproxies==0.9.4 cover: pytest-cov commands = @@ -74,6 +75,9 @@ deps = [testenv:docs] deps = -r{toxinidir}/docs/requirements.txt +usedevelop = true +install_command = + python -m pip install --no-use-pep517 {opts} {packages} commands = sphinx-build {posargs:-E} -b html docs dist/docs sphinx-build -b linkcheck docs dist/docs @@ -83,7 +87,7 @@ deps = coveralls skip_install = true commands = - coveralls --merge=extension-coveralls.json [] + coveralls {env:COVERALLS_EXTRAS:--merge=extension-coveralls.json} [] [testenv:extension-coveralls] deps = @@ -97,7 +101,6 @@ deps = codecov skip_install = true commands = - coverage xml --ignore-errors codecov [] [testenv:report]