From: DongHun Kwak Date: Tue, 29 Dec 2020 22:04:44 +0000 (+0900) Subject: Imported Upstream version 44.0.0 X-Git-Tag: upstream/44.0.0^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a8e66f140dc490499a60a28243c5a3855a5b706;p=platform%2Fupstream%2Fpython-setuptools.git Imported Upstream version 44.0.0 --- diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 25093b8..e1bfa89 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 43.0.0 +current_version = 44.0.0 commit = True tag = True diff --git a/.travis.yml b/.travis.yml index b3a6556..501a0b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,6 @@ jobs: env: DISABLE_COVERAGE=1 # Don't run coverage on pypy (too slow). - python: pypy3 env: DISABLE_COVERAGE=1 - - python: 3.4 - python: 3.5 - python: 3.6 - python: 3.7 diff --git a/CHANGES.rst b/CHANGES.rst index 817f816..109a3f4 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,9 @@ +v44.0.0 +------- + +* #1908: Drop support for Python 3.4. + + v43.0.0 ------- diff --git a/docs/easy_install.txt b/docs/easy_install.txt index 544b9ef..fac7b8f 100644 --- a/docs/easy_install.txt +++ b/docs/easy_install.txt @@ -41,7 +41,7 @@ Please see the `setuptools PyPI page `_ for download links and basic installation instructions for each of the supported platforms. -You will need at least Python 3.4 or 2.7. An ``easy_install`` script will be +You will need at least Python 3.5 or 2.7. An ``easy_install`` script will be installed in the normal location for Python scripts on your platform. Note that the instructions on the setuptools PyPI page assume that you are diff --git a/docs/setuptools.txt b/docs/setuptools.txt index c109e67..03b57cf 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -62,7 +62,7 @@ Installing ``setuptools`` To install the latest version of setuptools, use:: - pip install -U setuptools + pip install --upgrade setuptools Refer to `Installing Packages`_ guide for more information. @@ -1199,7 +1199,7 @@ command; see the section on the `develop`_ command below for more details. Note that you can also apply setuptools commands to non-setuptools projects, using commands like this:: - python -c "import setuptools; execfile('setup.py')" develop + python -c "import setuptools; with open('setup.py') as f: exec(compile(f.read(), 'setup.py', 'exec'))" develop That is, you can simply list the normal setup commands and options following the quoted part. @@ -1215,7 +1215,7 @@ Detailed instructions to distribute a setuptools project can be found at Before you begin, make sure you have the latest versions of setuptools and wheel:: - python3 -m pip install --user --upgrade setuptools wheel + pip install --upgrade setuptools wheel To build a setuptools project, run this command from the same directory where setup.py is located:: @@ -1229,15 +1229,15 @@ https://test.pypi.org/account/register/. You will also need to verify your email to be able to upload any packages. You should install twine to be able to upload packages:: - python3 -m pip install --user --upgrade setuptools wheel + pip install --upgrade twine Now, to upload these archives, run:: - twine upload --repository-url https://test.pypi.org/legacy/ dist/* + twine upload --repository-url https://test.pypi.org/simple/ dist/* To install your newly uploaded package ``example_pkg``, you can use pip:: - python3 -m pip install --index-url https://test.pypi.org/simple/ example_pkg + pip install --index-url https://test.pypi.org/simple/ example_pkg If you have issues at any point, please refer to `Packaging project tutorials`_ for clarification. diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 51fb119..2f5aa64 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -88,8 +88,8 @@ __import__('pkg_resources.extern.packaging.markers') __metaclass__ = type -if (3, 0) < sys.version_info < (3, 4): - raise RuntimeError("Python 3.4 or later is required") +if (3, 0) < sys.version_info < (3, 5): + raise RuntimeError("Python 3.5 or later is required") if six.PY2: # Those builtin exceptions are only defined in Python 3 diff --git a/setup.cfg b/setup.cfg index a9a9b50..ecef860 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,7 @@ universal = 1 [metadata] name = setuptools -version = 43.0.0 +version = 44.0.0 description = Easily download, build, install, upgrade, and uninstall Python packages author = Python Packaging Authority author_email = distutils-sig@python.org @@ -38,7 +38,6 @@ classifiers = 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 @@ -50,7 +49,7 @@ classifiers = [options] zip_safe = True -python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.* +python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.* py_modules = easy_install packages = find: diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py index b27c4a8..8538dd2 100644 --- a/setuptools/tests/test_sdist.py +++ b/setuptools/tests/test_sdist.py @@ -1,10 +1,9 @@ # -*- coding: utf-8 -*- """sdist tests""" -from __future__ import print_function +from __future__ import print_function, unicode_literals import os -import shutil import sys import tempfile import unicodedata @@ -91,30 +90,28 @@ fail_on_latin1_encoded_filenames = pytest.mark.xfail( ) +def touch(path): + path.write_text('', encoding='utf-8') + + class TestSdistTest: - def setup_method(self, method): - self.temp_dir = tempfile.mkdtemp() - with open(os.path.join(self.temp_dir, 'setup.py'), 'w') as f: - f.write(SETUP_PY) + @pytest.fixture(autouse=True) + def source_dir(self, tmpdir): + (tmpdir / 'setup.py').write_text(SETUP_PY, encoding='utf-8') # Set up the rest of the test package - test_pkg = os.path.join(self.temp_dir, 'sdist_test') - os.mkdir(test_pkg) - data_folder = os.path.join(self.temp_dir, "d") - os.mkdir(data_folder) + test_pkg = tmpdir / 'sdist_test' + test_pkg.mkdir() + data_folder = tmpdir / 'd' + data_folder.mkdir() # *.rst was not included in package_data, so c.rst should not be # automatically added to the manifest when not under version control - for fname in ['__init__.py', 'a.txt', 'b.txt', 'c.rst', - os.path.join(data_folder, "e.dat")]: - # Just touch the files; their contents are irrelevant - open(os.path.join(test_pkg, fname), 'w').close() + for fname in ['__init__.py', 'a.txt', 'b.txt', 'c.rst']: + touch(test_pkg / fname) + touch(data_folder / 'e.dat') - self.old_cwd = os.getcwd() - os.chdir(self.temp_dir) - - def teardown_method(self, method): - os.chdir(self.old_cwd) - shutil.rmtree(self.temp_dir) + with tmpdir.as_cwd(): + yield def test_package_data_in_sdist(self): """Regression test for pull request #4: ensures that files listed in @@ -177,14 +174,14 @@ class TestSdistTest: manifest = cmd.filelist.files assert 'setup.py' not in manifest - def test_defaults_case_sensitivity(self): + def test_defaults_case_sensitivity(self, tmpdir): """ Make sure default files (README.*, etc.) are added in a case-sensitive way to avoid problems with packages built on Windows. """ - open(os.path.join(self.temp_dir, 'readme.rst'), 'w').close() - open(os.path.join(self.temp_dir, 'SETUP.cfg'), 'w').close() + touch(tmpdir / 'readme.rst') + touch(tmpdir / 'SETUP.cfg') dist = Distribution(SETUP_ATTRS) # the extension deliberately capitalized for this test @@ -232,10 +229,6 @@ class TestSdistTest: u_contents = contents.decode('UTF-8') # The manifest should contain the UTF-8 filename - if six.PY2: - fs_enc = sys.getfilesystemencoding() - filename = filename.decode(fs_enc) - assert posix(filename) in u_contents @py3_only @@ -376,7 +369,7 @@ class TestSdistTest: @fail_on_latin1_encoded_filenames def test_sdist_with_utf8_encoded_filename(self): # Test for #303. - dist = Distribution(SETUP_ATTRS) + dist = Distribution(self.make_strings(SETUP_ATTRS)) dist.script_name = 'setup.py' cmd = sdist(dist) cmd.ensure_finalized() @@ -407,10 +400,19 @@ class TestSdistTest: else: assert filename in cmd.filelist.files + @classmethod + def make_strings(cls, item): + if isinstance(item, dict): + return { + key: cls.make_strings(value) for key, value in item.items()} + if isinstance(item, list): + return list(map(cls.make_strings, item)) + return str(item) + @fail_on_latin1_encoded_filenames def test_sdist_with_latin1_encoded_filename(self): # Test for #303. - dist = Distribution(SETUP_ATTRS) + dist = Distribution(self.make_strings(SETUP_ATTRS)) dist.script_name = 'setup.py' cmd = sdist(dist) cmd.ensure_finalized() @@ -451,11 +453,11 @@ class TestSdistTest: except UnicodeDecodeError: filename not in cmd.filelist.files - def test_pyproject_toml_in_sdist(self): + def test_pyproject_toml_in_sdist(self, tmpdir): """ Check if pyproject.toml is included in source distribution if present """ - open(os.path.join(self.temp_dir, 'pyproject.toml'), 'w').close() + touch(tmpdir / 'pyproject.toml') dist = Distribution(SETUP_ATTRS) dist.script_name = 'setup.py' cmd = sdist(dist) @@ -465,11 +467,11 @@ class TestSdistTest: manifest = cmd.filelist.files assert 'pyproject.toml' in manifest - def test_pyproject_toml_excluded(self): + def test_pyproject_toml_excluded(self, tmpdir): """ Check that pyproject.toml can excluded even if present """ - open(os.path.join(self.temp_dir, 'pyproject.toml'), 'w').close() + touch(tmpdir / 'pyproject.toml') with open('MANIFEST.in', 'w') as mts: print('exclude pyproject.toml', file=mts) dist = Distribution(SETUP_ATTRS) diff --git a/setuptools/tests/test_virtualenv.py b/setuptools/tests/test_virtualenv.py index cd3d931..2c35825 100644 --- a/setuptools/tests/test_virtualenv.py +++ b/setuptools/tests/test_virtualenv.py @@ -77,12 +77,9 @@ def _get_pip_versions(): 'pip==10.0.1', 'pip==18.1', 'pip==19.0.1', + 'https://github.com/pypa/pip/archive/master.zip', ] - # Pip's master dropped support for 3.4. - if not six.PY34: - network_versions.append('https://github.com/pypa/pip/archive/master.zip') - versions = [None] + [ pytest.param(v, **({} if network else {'marks': pytest.mark.skip})) for v in network_versions diff --git a/tests/requirements.txt b/tests/requirements.txt index 1f8bd19..4b5e0ee 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,6 +1,5 @@ mock -pytest-flake8; python_version!="3.4" -pytest-flake8<=1.0.0; python_version=="3.4" +pytest-flake8 virtualenv>=13.0.0 pytest-virtualenv>=1.2.7 pytest>=3.7 diff --git a/tox.ini b/tox.ini index 6d3b9a9..6a1af56 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ # # To run Tox against all supported Python interpreters, you can set: # -# export TOXENV='py27,py3{4,5,6},pypy,pypy3' +# export TOXENV='py27,py3{5,6,7,8},pypy,pypy3' [tox] envlist=python