[bumpversion]
-current_version = 41.0.0
+current_version = 41.0.1
commit = True
tag = True
-dist: trusty
+dist: xenial
language: python
jobs:
- <<: *latest_py2
env: LANG=C
- python: pypy2.7-6.0.0
- dist: xenial
env: DISABLE_COVERAGE=1 # Don't run coverage on pypy (too slow).
- - python: pypy3
+ - python: pypy3.5-6.0.0
env: DISABLE_COVERAGE=1
- python: 3.4
- python: 3.5
python: 3.6
- &latest_py3
python: 3.7
- dist: xenial
- <<: *latest_py3
env: LANG=C
- python: 3.8-dev
- dist: xenial
- env: DISABLE_COVERAGE=1 # Ignore invalid coverage data.
- <<: *default_py
stage: deploy (to PyPI for tagged commits)
if: tag IS present
+v41.0.1
+-------
+
+* #1671: Fixed issue with the PEP 517 backend that prevented building a wheel when the ``dist/`` directory contained existing ``.whl`` files.
+* #1709: In test.paths_on_python_path, avoid adding unnecessary duplicates to the PYTHONPATH.
+* #1741: In package_index, now honor "current directory" during a checkout of git and hg repositories under Windows
+
+
v41.0.0
-------
19.7
----
-* `Off-project PR <https://github.com/jaraco/setuptools/pull/32>`_:
- For FreeBSD, also honor root certificates from ca_root_nss.
+* Off-project PR: `0dcee79 <https://github.com/pypa/setuptools/commit/0dcee791dfdcfacddaaec79b29f30a347a147413>`_ and `f9bd9b9 <https://github.com/pypa/setuptools/commit/f9bd9b9f5df54ef5a0bf8d16c3a889ab8c640580>`_
+ For FreeBSD, also `honor root certificates from ca_root_nss <https://github.com/pypa/setuptools/commit/3ae46c30225eb46e1f5aada1a19e88b79f04dc72>`_.
19.6.2
------
now logged when pkg_resources is imported on Python 3.2 or earlier
Python 3 versions.
* `Add support for python_platform_implementation environment marker
- <https://github.com/jaraco/setuptools/pull/28>`_.
+ <https://github.com/pypa/setuptools/commit/94416707fd59a65f4a8f7f70541d6b3fc018b626>`_.
* `Fix dictionary mutation during iteration
- <https://github.com/jaraco/setuptools/pull/29>`_.
+ <https://github.com/pypa/setuptools/commit/57ebfa41e0f96b97e599ecd931b7ae8a143e096e>`_.
18.4
----
---
* Prefer vendored packaging library `as recommended
- <https://github.com/jaraco/setuptools/commit/170657b68f4b92e7e1bf82f5e19a831f5744af67#commitcomment-9109448>`_.
+ <https://github.com/pypa/setuptools/commit/170657b68f4b92e7e1bf82f5e19a831f5744af67>`_.
9.0.1
-----
[metadata]
license_file = LICENSE
-version = 41.0.0
+version = 41.0.1
import setuptools
import distutils
+from setuptools.py31compat import TemporaryDirectory
from pkg_resources import parse_requirements
metadata_directory=None):
config_settings = self._fix_config(config_settings)
wheel_directory = os.path.abspath(wheel_directory)
- sys.argv = sys.argv[:1] + ['bdist_wheel'] + \
- config_settings["--global-option"]
- self.run_setup()
- if wheel_directory != 'dist':
- shutil.rmtree(wheel_directory)
- shutil.copytree('dist', wheel_directory)
- return _file_with_extension(wheel_directory, '.whl')
+ # Build the wheel in a temporary directory, then copy to the target
+ with TemporaryDirectory(dir=wheel_directory) as tmp_dist_dir:
+ sys.argv = (sys.argv[:1] +
+ ['bdist_wheel', '--dist-dir', tmp_dist_dir] +
+ config_settings["--global-option"])
+ self.run_setup()
+
+ wheel_basename = _file_with_extension(tmp_dist_dir, '.whl')
+ wheel_path = os.path.join(wheel_directory, wheel_basename)
+ if os.path.exists(wheel_path):
+ # os.rename will fail overwriting on non-unix env
+ os.remove(wheel_path)
+ os.rename(os.path.join(tmp_dist_dir, wheel_basename), wheel_path)
+
+ return wheel_basename
def build_sdist(self, sdist_directory, config_settings=None):
config_settings = self._fix_config(config_settings)
working_set, _namespace_packages, evaluate_marker,
add_activation_listener, require, EntryPoint)
from setuptools import Command
+from .build_py import _unique_everseen
__metaclass__ = type
orig_pythonpath = os.environ.get('PYTHONPATH', nothing)
current_pythonpath = os.environ.get('PYTHONPATH', '')
try:
- prefix = os.pathsep.join(paths)
+ prefix = os.pathsep.join(_unique_everseen(paths))
to_join = filter(None, [prefix, current_pythonpath])
new_path = os.pathsep.join(to_join)
if new_path:
if rev is not None:
self.info("Checking out %s", rev)
- os.system("(cd %s && git checkout --quiet %s)" % (
+ os.system("git -C %s checkout --quiet %s" % (
filename,
rev,
))
if rev is not None:
self.info("Updating to %s", rev)
- os.system("(cd %s && hg up -C -r %s -q)" % (
+ os.system("hg --cwd %s up -C -r %s -q" % (
filename,
rev,
))
errors on deletion.
"""
- def __init__(self):
+ def __init__(self, **kwargs):
self.name = None # Handle mkdtemp raising an exception
- self.name = tempfile.mkdtemp()
+ self.name = tempfile.mkdtemp(**kwargs)
def __enter__(self):
return self.name
def __init__(self, *args, **kwargs):
super(BuildBackend, self).__init__(*args, **kwargs)
- self.pool = futures.ProcessPoolExecutor()
+ self.pool = futures.ProcessPoolExecutor(max_workers=1)
def __getattr__(self, name):
"""Handles aribrary function invocations on the build backend."""
assert os.path.isfile(os.path.join(dist_dir, wheel_name))
+ def test_build_wheel_with_existing_wheel_file_present(self, tmpdir_cwd):
+ # Building a wheel should still succeed if there's already a wheel
+ # in the wheel directory
+ files = {
+ 'setup.py': "from setuptools import setup\nsetup()",
+ 'VERSION': "0.0.1",
+ 'setup.cfg': DALS("""
+ [metadata]
+ name = foo
+ version = file: VERSION
+ """),
+ 'pyproject.toml': DALS("""
+ [build-system]
+ requires = ["setuptools", "wheel"]
+ build-backend = "setuptools.build_meta
+ """),
+ }
+
+ build_files(files)
+
+ dist_dir = os.path.abspath('pip-wheel-preexisting')
+ os.makedirs(dist_dir)
+
+ # make first wheel
+ build_backend = self.get_build_backend()
+ wheel_one = build_backend.build_wheel(dist_dir)
+
+ # change version
+ with open("VERSION", "wt") as version_file:
+ version_file.write("0.0.2")
+
+ # make *second* wheel
+ wheel_two = self.get_build_backend().build_wheel(dist_dir)
+
+ assert os.path.isfile(os.path.join(dist_dir, wheel_one))
+ assert wheel_one != wheel_two
+
+ # and if rebuilding the same wheel?
+ open(os.path.join(dist_dir, wheel_two), 'w').close()
+ wheel_three = self.get_build_backend().build_wheel(dist_dir)
+ assert wheel_three == wheel_two
+ assert os.path.getsize(os.path.join(dist_dir, wheel_three)) > 0
+
def test_build_sdist(self, build_backend):
dist_dir = os.path.abspath('pip-sdist')
os.makedirs(dist_dir)
first_call_args = os_system_mock.call_args_list[0][0]
assert first_call_args == (expected,)
- tmpl = '(cd {expected_dir} && git checkout --quiet master)'
+ tmpl = 'git -C {expected_dir} checkout --quiet master'
expected = tmpl.format(**locals())
assert os_system_mock.call_args_list[1][0] == (expected,)
assert result == expected_dir