From 578d2eca7232d429225d7de55f934ab303ad6f3f Mon Sep 17 00:00:00 2001 From: alvyjudy Date: Sun, 29 Mar 2020 21:40:38 -0400 Subject: initial draft for build_meta documentation --- docs/build_meta.txt | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 docs/build_meta.txt diff --git a/docs/build_meta.txt b/docs/build_meta.txt new file mode 100644 index 00000000..bfba1181 --- /dev/null +++ b/docs/build_meta.txt @@ -0,0 +1,88 @@ +======================================= +Documentation to setuptools.build_meta +======================================= + +What is it? +------------- + +Setuptools, or Python packaging in general, has faced many +`criticism `_ and +`PEP517 `_ attempts to fix this +issue by ``get distutils-sig out of the business of being a gatekeeper for +Python build system``. + +A quick overview on the `current state of Python packaging +`_. The ``distutils`` +package specified the de facto standard way to bundle up your packages:: + + setup.py + mypkg/__init__.py + +And then you run ``python setup.py bdist`` and compressed ``.tar.gz`` will be +available for distribution. + +Following this tradition, several other enhancements have been made: ``pip`` +was created and user can run ``pip install`` on their downloaded distribution +file and it will be installed. ``wheel`` format was created to minimize the +build process for C extension. ``PyPI`` and ``twine`` then made it easier to +upload and download the distribution and finally ``setuptools`` extends the +original ``distutils`` and emcompass everything else and become the standard +way for Python packaging. (check the timeline for accuracy) + +I'll skip the many downsides and complexity that came with the development +of setuptools. PEP517 aims to solve these issues by specifying a new +standardized way to distribute your packages which is not as compatible as +the setuptools module. + +``build_meta.py`` therefore acts as an adaptor to the PEP517 and the existing +setuptools. + +How to use it? +------------- + +Starting with a package that you want to distribute. You will need your source +scripts, a ``pyproject.toml`` file and a ``setup.cfg`` file. + + ~/meowpkg/ + pyproject.toml + setup.cfg + src/meowpkg/__init__.py + + +The pyproject.toml file is required by PEP517 and PEP518 to specify the build +system (i.e. what is being used to package your scripts). To use it with +setuptools, the content would be:: + + [build-system] + requires = ["setuptools", "wheel"] + build-backend = "setuptools.build-meta" + +The setup.cfg is used to specify your package information (essentially +replacing setup.py), specified on setuptools `documentation `_ :: + + [metadata] + name = meowpkg + version = 0.0.1 + description = a package that meows + + [options] + package_dir= + =src + packages = find: + + [options.packages.find] + where=src + +Now it's time to actually generate the distribution. PEP517 specifies two +mandatory functions, ``build_wheel`` and ``build_sdist``, implemented in +this module. Currently, it has to be done in the interpreter:: + + >>> import setuptools.build_meta + >>> setuptools.build_meta.build_wheel('wheel_dist') + 'meowpkg-0.0.1-py3-none-any.whl' + +And now it's done! The ``.whl`` file and ``.tar.gz`` can then be distributed +and installed! + -- cgit v1.2.1 From cc7186cde4238e9269beb2b19720380990759299 Mon Sep 17 00:00:00 2001 From: alvyjudy Date: Mon, 30 Mar 2020 13:25:17 -0400 Subject: First draft for build_meta documentation --- docs/build_meta.txt | 98 +++++++++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 45 deletions(-) diff --git a/docs/build_meta.txt b/docs/build_meta.txt index bfba1181..47e0aa74 100644 --- a/docs/build_meta.txt +++ b/docs/build_meta.txt @@ -5,37 +5,39 @@ Documentation to setuptools.build_meta What is it? ------------- -Setuptools, or Python packaging in general, has faced many -`criticism `_ and -`PEP517 `_ attempts to fix this -issue by ``get distutils-sig out of the business of being a gatekeeper for -Python build system``. - -A quick overview on the `current state of Python packaging -`_. The ``distutils`` -package specified the de facto standard way to bundle up your packages:: - - setup.py - mypkg/__init__.py - -And then you run ``python setup.py bdist`` and compressed ``.tar.gz`` will be -available for distribution. - -Following this tradition, several other enhancements have been made: ``pip`` -was created and user can run ``pip install`` on their downloaded distribution -file and it will be installed. ``wheel`` format was created to minimize the -build process for C extension. ``PyPI`` and ``twine`` then made it easier to -upload and download the distribution and finally ``setuptools`` extends the -original ``distutils`` and emcompass everything else and become the standard -way for Python packaging. (check the timeline for accuracy) - -I'll skip the many downsides and complexity that came with the development -of setuptools. PEP517 aims to solve these issues by specifying a new -standardized way to distribute your packages which is not as compatible as -the setuptools module. - -``build_meta.py`` therefore acts as an adaptor to the PEP517 and the existing -setuptools. +Python packaging has come `a long way `_. + +The traditional ``setuptools``'s way of packgaging Python modules +uses a ``setup()`` function within the ``setup.py`` script. Commands such as +``python setup.py bdist`` or ``python setup.py bdist_wheel`` generate a +distribution bundle and ``python setup.py install`` installs the distribution. +This interface makes it difficult to choose other packaging tools without an +overhaul. Additionally, the ``setup.py`` scripts hasn't been the most user +friendly tool. + +PEP517 therefore came to rescue and specified a new standard to +package and distribute Python modules. Under PEP517: + + a ``pyproject.toml`` file is used to specify what program to use + for generating distribution. + + Then, two functions provided by the program,``build_wheel(directory: str)`` + and ``build_sdist(directory: str)`` create the distribution bundle at the + specified ``directory``. The program is free to use its own configuration + script or extend the ``.toml`` file. + + Lastly, ``pip install *.whl`` or ``pip install *.tar.gz`` does the actual + installation. If ``*.whl`` is available, ``pip`` will go ahead and copy + the files into ``site-packages`` directory. If not, ``pip`` will look at + ``pyproject.toml`` and decide what program to use to 'build from source' + (the default is ``setuptools``) + +With this standard, switching between packaging tools becomes a lot easier and +in the case of ``setuptools``, ``setup.py`` becomes optional. + +``build_meta`` is ``setuptools``'s implementation of PEP517. It provides the +two functions, ``build_wheel`` and ``build_sdist``, amongst others and uses +a ``setup.cfg`` to specify the information about the package. How to use it? ------------- @@ -46,21 +48,20 @@ scripts, a ``pyproject.toml`` file and a ``setup.cfg`` file. ~/meowpkg/ pyproject.toml setup.cfg - src/meowpkg/__init__.py + meowpkg/__init__.py -The pyproject.toml file is required by PEP517 and PEP518 to specify the build -system (i.e. what is being used to package your scripts). To use it with +The pyproject.toml file is required to specify the build system (i.e. what is +being used to package your scripts and install from source). To use it with setuptools, the content would be:: [build-system] requires = ["setuptools", "wheel"] - build-backend = "setuptools.build-meta" + build-backend = "setuptools.build_meta" -The setup.cfg is used to specify your package information (essentially -replacing setup.py), specified on setuptools `documentation `_ :: +``setup.cfg`` is used to specify your package information, specified +`here `_ :: [metadata] name = meowpkg @@ -68,13 +69,8 @@ using-setup-cfg-files>`_ :: description = a package that meows [options] - package_dir= - =src packages = find: - [options.packages.find] - where=src - Now it's time to actually generate the distribution. PEP517 specifies two mandatory functions, ``build_wheel`` and ``build_sdist``, implemented in this module. Currently, it has to be done in the interpreter:: @@ -82,7 +78,19 @@ this module. Currently, it has to be done in the interpreter:: >>> import setuptools.build_meta >>> setuptools.build_meta.build_wheel('wheel_dist') 'meowpkg-0.0.1-py3-none-any.whl' + >>> setuptools.build_meta.build_sdist('sdist') + 'meowpkg-0.0.1.tar.gz' And now it's done! The ``.whl`` file and ``.tar.gz`` can then be distributed -and installed! +and installed:: + + ~/newcomputer/ + meowpkg-0.0.1.whl + meowpkg-0.0.1.tar.gz + + $ pip install meowpkg-0.0.1.whl + +or:: + + $ pip install meowpkg-0.0.1.tar.gz -- cgit v1.2.1 From b5697f4458e0a2bbdb0d5a46222bb7e7adad8071 Mon Sep 17 00:00:00 2001 From: alvyjudy <53921639+alvyjudy@users.noreply.github.com> Date: Mon, 30 Mar 2020 13:27:31 -0400 Subject: deleted blank lines and fixed underline --- docs/build_meta.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/build_meta.txt b/docs/build_meta.txt index 47e0aa74..8d92d804 100644 --- a/docs/build_meta.txt +++ b/docs/build_meta.txt @@ -40,7 +40,7 @@ two functions, ``build_wheel`` and ``build_sdist``, amongst others and uses a ``setup.cfg`` to specify the information about the package. How to use it? -------------- +-------------- Starting with a package that you want to distribute. You will need your source scripts, a ``pyproject.toml`` file and a ``setup.cfg`` file. @@ -49,8 +49,7 @@ scripts, a ``pyproject.toml`` file and a ``setup.cfg`` file. pyproject.toml setup.cfg meowpkg/__init__.py - - + The pyproject.toml file is required to specify the build system (i.e. what is being used to package your scripts and install from source). To use it with setuptools, the content would be:: -- cgit v1.2.1 From 71af92d2e1f00162e46fe9c72370cad7e9bd0c5f Mon Sep 17 00:00:00 2001 From: alvyjudy <53921639+alvyjudy@users.noreply.github.com> Date: Mon, 30 Mar 2020 13:30:30 -0400 Subject: fixed some RST syntax --- docs/build_meta.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/build_meta.txt b/docs/build_meta.txt index 8d92d804..4467ddda 100644 --- a/docs/build_meta.txt +++ b/docs/build_meta.txt @@ -21,7 +21,7 @@ package and distribute Python modules. Under PEP517: a ``pyproject.toml`` file is used to specify what program to use for generating distribution. - Then, two functions provided by the program,``build_wheel(directory: str)`` + Then, two functions provided by the program, ``build_wheel(directory: str)`` and ``build_sdist(directory: str)`` create the distribution bundle at the specified ``directory``. The program is free to use its own configuration script or extend the ``.toml`` file. @@ -43,7 +43,7 @@ How to use it? -------------- Starting with a package that you want to distribute. You will need your source -scripts, a ``pyproject.toml`` file and a ``setup.cfg`` file. +scripts, a ``pyproject.toml`` file and a ``setup.cfg`` file:: ~/meowpkg/ pyproject.toml -- cgit v1.2.1 From 19e45c14e49fa3e6cc849b69b3a83f85f316441c Mon Sep 17 00:00:00 2001 From: alvyjudy Date: Mon, 30 Mar 2020 13:49:29 -0400 Subject: added changelog file --- changelog.d/1698.doc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/1698.doc.rst diff --git a/changelog.d/1698.doc.rst b/changelog.d/1698.doc.rst new file mode 100644 index 00000000..9b61fccb --- /dev/null +++ b/changelog.d/1698.doc.rst @@ -0,0 +1 @@ +Added documentation for ``build_meta`` (a bare minimum, not completed) -- cgit v1.2.1 From e5f3305933e65fbebe1562a3625cf16abb10a10b Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Sat, 11 Apr 2020 18:11:31 +0000 Subject: change: Mac OS X -> macOS Signed-off-by: Reece Dunham --- .gitignore | 1 + CHANGES.rst | 10 +++++----- docs/history.txt | 2 +- docs/pkg_resources.txt | 6 +++--- pkg_resources/__init__.py | 26 +++++++++++++------------- pkg_resources/_vendor/appdirs.py | 21 ++++++++++----------- pkg_resources/api_tests.txt | 4 ++-- setuptools/package_index.py | 2 +- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index 0c272d1c..90ae8050 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ setuptools.egg-info .cache .idea/ .pytest_cache/ +.mypy_cache/ diff --git a/CHANGES.rst b/CHANGES.rst index f97f5142..201ac692 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1461,7 +1461,7 @@ v21.1.0 * #572: In build_ext, now always import ``_CONFIG_VARS`` from ``distutils`` rather than from ``sysconfig`` to allow ``distutils.sysconfig.customize_compiler`` - configure the OS X compiler for ``-dynamiclib``. + configure the macOS compiler for ``-dynamiclib``. v21.0.0 ------- @@ -1881,7 +1881,7 @@ v20.6.0 require that Cython be present before building source distributions. However, for systems with this build of setuptools, Cython will be downloaded on demand. -* Issue #396: Fixed test failure on OS X. +* Issue #396: Fixed test failure on macOS. * BB Pull Request #136: Remove excessive quoting from shebang headers for Jython. @@ -3078,7 +3078,7 @@ how it parses version numbers. * Distribute #306: Even if 2to3 is used, we build in-place under Python 2. * Distribute #307: Prints the full path when .svn/entries is broken. * Distribute #313: Support for sdist subcommands (Python 2.7) -* Distribute #314: test_local_index() would fail an OS X. +* Distribute #314: test_local_index() would fail an macOS. * Distribute #310: Non-ascii characters in a namespace __init__.py causes errors. * Distribute #218: Improved documentation on behavior of `package_data` and `include_package_data`. Files indicated by `package_data` are now included @@ -4105,7 +4105,7 @@ easy_install based on a contribution by Kevin Dangoor. You may wish to delete and reinstall any eggs whose filename includes "darwin" and "Power_Macintosh", because the format for this platform information has changed so that minor - OS X upgrades (such as 10.4.1 to 10.4.2) do not cause eggs built with a + macOS upgrades (such as 10.4.1 to 10.4.2) do not cause eggs built with a previous OS version to become obsolete. * easy_install's dependency processing algorithms have changed. When using @@ -4118,7 +4118,7 @@ easy_install * Added ``--site-dirs`` option to allow adding custom "site" directories. Made ``easy-install.pth`` work in platform-specific alternate site - directories (e.g. ``~/Library/Python/2.x/site-packages`` on Mac OS X). + directories (e.g. ``~/Library/Python/2.x/site-packages`` on macOS). * If you manually delete the current version of a package, the next run of EasyInstall against the target directory will now remove the stray entry diff --git a/docs/history.txt b/docs/history.txt index 385cfa7e..faf7adfe 100644 --- a/docs/history.txt +++ b/docs/history.txt @@ -12,7 +12,7 @@ Credits * The original design for the ``.egg`` format and the ``pkg_resources`` API was co-created by Phillip Eby and Bob Ippolito. Bob also implemented the first - version of ``pkg_resources``, and supplied the OS X operating system version + version of ``pkg_resources``, and supplied the macOS operating system version compatibility algorithm. * Ian Bicking implemented many early "creature comfort" features of diff --git a/docs/pkg_resources.txt b/docs/pkg_resources.txt index b887a923..71568c1a 100644 --- a/docs/pkg_resources.txt +++ b/docs/pkg_resources.txt @@ -1621,7 +1621,7 @@ Platform Utilities ``get_build_platform()`` Return this platform's identifier string. For Windows, the return value - is ``"win32"``, and for Mac OS X it is a string of the form + is ``"win32"``, and for macOS it is a string of the form ``"macosx-10.4-ppc"``. All other platforms return the same uname-based string that the ``distutils.util.get_platform()`` function returns. This string is the minimum platform version required by distributions built @@ -1641,7 +1641,7 @@ Platform Utilities considered a wildcard, and the platforms are therefore compatible. Likewise, if the platform strings are equal, they're also considered compatible, and ``True`` is returned. Currently, the only non-equal - platform strings that are considered compatible are Mac OS X platform + platform strings that are considered compatible are macOS platform strings with the same hardware type (e.g. ``ppc``) and major version (e.g. ``10``) with the `provided` platform's minor version being less than or equal to the `required` platform's minor version. @@ -1674,7 +1674,7 @@ File/Path Utilities the same filesystem location if they have equal ``normalized_path()`` values. Specifically, this is a shortcut for calling ``os.path.realpath`` and ``os.path.normcase`` on `path`. Unfortunately, on certain platforms - (notably Cygwin and Mac OS X) the ``normcase`` function does not accurately + (notably Cygwin and macOS) the ``normcase`` function does not accurately reflect the platform's case-sensitivity, so there is always the possibility of two apparently-different paths being equal on such platforms. diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 75563f95..e7f863b1 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -179,10 +179,10 @@ def get_supported_platform(): """Return this platform's maximum compatible version. distutils.util.get_platform() normally reports the minimum version - of Mac OS X that would be required to *use* extensions produced by + of macOS that would be required to *use* extensions produced by distutils. But what we want when checking compatibility is to know the - version of Mac OS X that we are *running*. To allow usage of packages that - explicitly require a newer version of Mac OS X, we must also know the + version of macOS that we are *running*. To allow usage of packages that + explicitly require a newer version of macOS, we must also know the current version of the OS. If this condition occurs for any other platform with a version in its @@ -192,9 +192,9 @@ def get_supported_platform(): m = macosVersionString.match(plat) if m is not None and sys.platform == "darwin": try: - plat = 'macosx-%s-%s' % ('.'.join(_macosx_vers()[:2]), m.group(3)) + plat = 'macosx-%s-%s' % ('.'.join(_macos_vers()[:2]), m.group(3)) except ValueError: - # not Mac OS X + # not macOS pass return plat @@ -365,7 +365,7 @@ def get_provider(moduleOrReq): return _find_adapter(_provider_factories, loader)(module) -def _macosx_vers(_cache=[]): +def _macos_vers(_cache=[]): if not _cache: version = platform.mac_ver()[0] # fallback for MacPorts @@ -381,7 +381,7 @@ def _macosx_vers(_cache=[]): return _cache[0] -def _macosx_arch(machine): +def _macos_arch(machine): return {'PowerPC': 'ppc', 'Power_Macintosh': 'ppc'}.get(machine, machine) @@ -389,18 +389,18 @@ def get_build_platform(): """Return this platform's string for platform-specific distributions XXX Currently this is the same as ``distutils.util.get_platform()``, but it - needs some hacks for Linux and Mac OS X. + needs some hacks for Linux and macOS. """ from sysconfig import get_platform plat = get_platform() if sys.platform == "darwin" and not plat.startswith('macosx-'): try: - version = _macosx_vers() + version = _macos_vers() machine = os.uname()[4].replace(" ", "_") return "macosx-%d.%d-%s" % ( int(version[0]), int(version[1]), - _macosx_arch(machine), + _macos_arch(machine), ) except ValueError: # if someone is running a non-Mac darwin system, this will fall @@ -426,7 +426,7 @@ def compatible_platforms(provided, required): # easy case return True - # Mac OS X special cases + # macOS special cases reqMac = macosVersionString.match(required) if reqMac: provMac = macosVersionString.match(provided) @@ -435,7 +435,7 @@ def compatible_platforms(provided, required): if not provMac: # this is backwards compatibility for packages built before # setuptools 0.6. All packages built after this point will - # use the new macosx designation. + # use the new macOS designation. provDarwin = darwinVersionString.match(provided) if provDarwin: dversion = int(provDarwin.group(1)) @@ -443,7 +443,7 @@ def compatible_platforms(provided, required): if dversion == 7 and macosversion >= "10.3" or \ dversion == 8 and macosversion >= "10.4": return True - # egg isn't macosx or legacy darwin + # egg isn't macOS or legacy darwin return False # are they the same major version and machine type? diff --git a/pkg_resources/_vendor/appdirs.py b/pkg_resources/_vendor/appdirs.py index ae67001a..4552cbbf 100644 --- a/pkg_resources/_vendor/appdirs.py +++ b/pkg_resources/_vendor/appdirs.py @@ -8,10 +8,9 @@ See for details and usage. """ # Dev Notes: -# - MSDN on where to store app data files: -# http://support.microsoft.com/default.aspx?scid=kb;en-us;310294#XSLTH3194121123120121120120 -# - Mac OS X: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/index.html -# - XDG spec for Un*x: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html +# - MSDN on where to store app data files: (TODO: needs new link) +# - macOS: (TODO: needs new link) +# - XDG spec for Un*x: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html __version_info__ = (1, 4, 3) __version__ = '.'.join(map(str, __version_info__)) @@ -64,7 +63,7 @@ def user_data_dir(appname=None, appauthor=None, version=None, roaming=False): for a discussion of issues. Typical user data directories are: - Mac OS X: ~/Library/Application Support/ + macOS: ~/Library/Application Support/ Unix: ~/.local/share/ # or in $XDG_DATA_HOME, if defined Win XP (not roaming): C:\Documents and Settings\\Application Data\\ Win XP (roaming): C:\Documents and Settings\\Local Settings\Application Data\\ @@ -118,7 +117,7 @@ def site_data_dir(appname=None, appauthor=None, version=None, multipath=False): if XDG_DATA_DIRS is not set Typical site data directories are: - Mac OS X: /Library/Application Support/ + macOS: /Library/Application Support/ Unix: /usr/local/share/ or /usr/share/ Win XP: C:\Documents and Settings\All Users\Application Data\\ Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) @@ -185,7 +184,7 @@ def user_config_dir(appname=None, appauthor=None, version=None, roaming=False): for a discussion of issues. Typical user config directories are: - Mac OS X: same as user_data_dir + macOS: same as user_data_dir Unix: ~/.config/ # or in $XDG_CONFIG_HOME, if defined Win *: same as user_data_dir @@ -223,7 +222,7 @@ def site_config_dir(appname=None, appauthor=None, version=None, multipath=False) returned, or '/etc/xdg/', if XDG_CONFIG_DIRS is not set Typical site config directories are: - Mac OS X: same as site_data_dir + macOS: same as site_data_dir Unix: /etc/xdg/ or $XDG_CONFIG_DIRS[i]/ for each value in $XDG_CONFIG_DIRS Win *: same as site_data_dir @@ -273,7 +272,7 @@ def user_cache_dir(appname=None, appauthor=None, version=None, opinion=True): discussion below. Typical user cache directories are: - Mac OS X: ~/Library/Caches/ + macOS: ~/Library/Caches/ Unix: ~/.cache/ (XDG default) Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Cache Vista: C:\Users\\AppData\Local\\\Cache @@ -333,7 +332,7 @@ def user_state_dir(appname=None, appauthor=None, version=None, roaming=False): for a discussion of issues. Typical user state directories are: - Mac OS X: same as user_data_dir + macOS: same as user_data_dir Unix: ~/.local/state/ # or in $XDG_STATE_HOME, if defined Win *: same as user_data_dir @@ -372,7 +371,7 @@ def user_log_dir(appname=None, appauthor=None, version=None, opinion=True): base cache dir for Unix. See discussion below. Typical user log directories are: - Mac OS X: ~/Library/Logs/ + macOS: ~/Library/Logs/ Unix: ~/.cache//log # or under $XDG_CACHE_HOME if defined Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Logs Vista: C:\Users\\AppData\Local\\\Logs diff --git a/pkg_resources/api_tests.txt b/pkg_resources/api_tests.txt index 7ae5a038..ded18800 100644 --- a/pkg_resources/api_tests.txt +++ b/pkg_resources/api_tests.txt @@ -290,8 +290,8 @@ Platform Compatibility Rules ---------------------------- On the Mac, there are potential compatibility issues for modules compiled -on newer versions of Mac OS X than what the user is running. Additionally, -Mac OS X will soon have two platforms to contend with: Intel and PowerPC. +on newer versions of macOS than what the user is running. Additionally, +macOS will soon have two platforms to contend with: Intel and PowerPC. Basic equality works as on other platforms:: diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 82eb4516..91806091 100644 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -1051,7 +1051,7 @@ def open_with_auth(url, opener=urllib.request.urlopen): parsed = urllib.parse.urlparse(url) scheme, netloc, path, params, query, frag = parsed - # Double scheme does not raise on Mac OS X as revealed by a + # Double scheme does not raise on macOS as revealed by a # failing test. We would expect "nonnumeric port". Refs #20. if netloc.endswith(':'): raise http_client.InvalidURL("nonnumeric port: ''") -- cgit v1.2.1 From bafe5abd8c715fa18a06bfd62e685802a2a74ce8 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Sat, 11 Apr 2020 18:11:31 +0000 Subject: change: Mac OS X -> macOS Signed-off-by: Reece Dunham --- .gitignore | 1 + CHANGES.rst | 10 +++++----- docs/history.txt | 2 +- docs/pkg_resources.txt | 6 +++--- pkg_resources/__init__.py | 26 +++++++++++++------------- pkg_resources/_vendor/appdirs.py | 21 ++++++++++----------- pkg_resources/api_tests.txt | 4 ++-- setuptools/package_index.py | 2 +- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index 0c272d1c..90ae8050 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ setuptools.egg-info .cache .idea/ .pytest_cache/ +.mypy_cache/ diff --git a/CHANGES.rst b/CHANGES.rst index ac61c178..c145eb39 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1519,7 +1519,7 @@ v21.1.0 * #572: In build_ext, now always import ``_CONFIG_VARS`` from ``distutils`` rather than from ``sysconfig`` to allow ``distutils.sysconfig.customize_compiler`` - configure the OS X compiler for ``-dynamiclib``. + configure the macOS compiler for ``-dynamiclib``. v21.0.0 ------- @@ -1939,7 +1939,7 @@ v20.6.0 require that Cython be present before building source distributions. However, for systems with this build of setuptools, Cython will be downloaded on demand. -* Issue #396: Fixed test failure on OS X. +* Issue #396: Fixed test failure on macOS. * BB Pull Request #136: Remove excessive quoting from shebang headers for Jython. @@ -3136,7 +3136,7 @@ how it parses version numbers. * Distribute #306: Even if 2to3 is used, we build in-place under Python 2. * Distribute #307: Prints the full path when .svn/entries is broken. * Distribute #313: Support for sdist subcommands (Python 2.7) -* Distribute #314: test_local_index() would fail an OS X. +* Distribute #314: test_local_index() would fail an macOS. * Distribute #310: Non-ascii characters in a namespace __init__.py causes errors. * Distribute #218: Improved documentation on behavior of `package_data` and `include_package_data`. Files indicated by `package_data` are now included @@ -4163,7 +4163,7 @@ easy_install based on a contribution by Kevin Dangoor. You may wish to delete and reinstall any eggs whose filename includes "darwin" and "Power_Macintosh", because the format for this platform information has changed so that minor - OS X upgrades (such as 10.4.1 to 10.4.2) do not cause eggs built with a + macOS upgrades (such as 10.4.1 to 10.4.2) do not cause eggs built with a previous OS version to become obsolete. * easy_install's dependency processing algorithms have changed. When using @@ -4176,7 +4176,7 @@ easy_install * Added ``--site-dirs`` option to allow adding custom "site" directories. Made ``easy-install.pth`` work in platform-specific alternate site - directories (e.g. ``~/Library/Python/2.x/site-packages`` on Mac OS X). + directories (e.g. ``~/Library/Python/2.x/site-packages`` on macOS). * If you manually delete the current version of a package, the next run of EasyInstall against the target directory will now remove the stray entry diff --git a/docs/history.txt b/docs/history.txt index 385cfa7e..faf7adfe 100644 --- a/docs/history.txt +++ b/docs/history.txt @@ -12,7 +12,7 @@ Credits * The original design for the ``.egg`` format and the ``pkg_resources`` API was co-created by Phillip Eby and Bob Ippolito. Bob also implemented the first - version of ``pkg_resources``, and supplied the OS X operating system version + version of ``pkg_resources``, and supplied the macOS operating system version compatibility algorithm. * Ian Bicking implemented many early "creature comfort" features of diff --git a/docs/pkg_resources.txt b/docs/pkg_resources.txt index b887a923..71568c1a 100644 --- a/docs/pkg_resources.txt +++ b/docs/pkg_resources.txt @@ -1621,7 +1621,7 @@ Platform Utilities ``get_build_platform()`` Return this platform's identifier string. For Windows, the return value - is ``"win32"``, and for Mac OS X it is a string of the form + is ``"win32"``, and for macOS it is a string of the form ``"macosx-10.4-ppc"``. All other platforms return the same uname-based string that the ``distutils.util.get_platform()`` function returns. This string is the minimum platform version required by distributions built @@ -1641,7 +1641,7 @@ Platform Utilities considered a wildcard, and the platforms are therefore compatible. Likewise, if the platform strings are equal, they're also considered compatible, and ``True`` is returned. Currently, the only non-equal - platform strings that are considered compatible are Mac OS X platform + platform strings that are considered compatible are macOS platform strings with the same hardware type (e.g. ``ppc``) and major version (e.g. ``10``) with the `provided` platform's minor version being less than or equal to the `required` platform's minor version. @@ -1674,7 +1674,7 @@ File/Path Utilities the same filesystem location if they have equal ``normalized_path()`` values. Specifically, this is a shortcut for calling ``os.path.realpath`` and ``os.path.normcase`` on `path`. Unfortunately, on certain platforms - (notably Cygwin and Mac OS X) the ``normcase`` function does not accurately + (notably Cygwin and macOS) the ``normcase`` function does not accurately reflect the platform's case-sensitivity, so there is always the possibility of two apparently-different paths being equal on such platforms. diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 15a4401a..b0a49d86 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -179,10 +179,10 @@ def get_supported_platform(): """Return this platform's maximum compatible version. distutils.util.get_platform() normally reports the minimum version - of Mac OS X that would be required to *use* extensions produced by + of macOS that would be required to *use* extensions produced by distutils. But what we want when checking compatibility is to know the - version of Mac OS X that we are *running*. To allow usage of packages that - explicitly require a newer version of Mac OS X, we must also know the + version of macOS that we are *running*. To allow usage of packages that + explicitly require a newer version of macOS, we must also know the current version of the OS. If this condition occurs for any other platform with a version in its @@ -192,9 +192,9 @@ def get_supported_platform(): m = macosVersionString.match(plat) if m is not None and sys.platform == "darwin": try: - plat = 'macosx-%s-%s' % ('.'.join(_macosx_vers()[:2]), m.group(3)) + plat = 'macosx-%s-%s' % ('.'.join(_macos_vers()[:2]), m.group(3)) except ValueError: - # not Mac OS X + # not macOS pass return plat @@ -365,7 +365,7 @@ def get_provider(moduleOrReq): return _find_adapter(_provider_factories, loader)(module) -def _macosx_vers(_cache=[]): +def _macos_vers(_cache=[]): if not _cache: version = platform.mac_ver()[0] # fallback for MacPorts @@ -381,7 +381,7 @@ def _macosx_vers(_cache=[]): return _cache[0] -def _macosx_arch(machine): +def _macos_arch(machine): return {'PowerPC': 'ppc', 'Power_Macintosh': 'ppc'}.get(machine, machine) @@ -389,18 +389,18 @@ def get_build_platform(): """Return this platform's string for platform-specific distributions XXX Currently this is the same as ``distutils.util.get_platform()``, but it - needs some hacks for Linux and Mac OS X. + needs some hacks for Linux and macOS. """ from sysconfig import get_platform plat = get_platform() if sys.platform == "darwin" and not plat.startswith('macosx-'): try: - version = _macosx_vers() + version = _macos_vers() machine = os.uname()[4].replace(" ", "_") return "macosx-%d.%d-%s" % ( int(version[0]), int(version[1]), - _macosx_arch(machine), + _macos_arch(machine), ) except ValueError: # if someone is running a non-Mac darwin system, this will fall @@ -426,7 +426,7 @@ def compatible_platforms(provided, required): # easy case return True - # Mac OS X special cases + # macOS special cases reqMac = macosVersionString.match(required) if reqMac: provMac = macosVersionString.match(provided) @@ -435,7 +435,7 @@ def compatible_platforms(provided, required): if not provMac: # this is backwards compatibility for packages built before # setuptools 0.6. All packages built after this point will - # use the new macosx designation. + # use the new macOS designation. provDarwin = darwinVersionString.match(provided) if provDarwin: dversion = int(provDarwin.group(1)) @@ -443,7 +443,7 @@ def compatible_platforms(provided, required): if dversion == 7 and macosversion >= "10.3" or \ dversion == 8 and macosversion >= "10.4": return True - # egg isn't macosx or legacy darwin + # egg isn't macOS or legacy darwin return False # are they the same major version and machine type? diff --git a/pkg_resources/_vendor/appdirs.py b/pkg_resources/_vendor/appdirs.py index ae67001a..4552cbbf 100644 --- a/pkg_resources/_vendor/appdirs.py +++ b/pkg_resources/_vendor/appdirs.py @@ -8,10 +8,9 @@ See for details and usage. """ # Dev Notes: -# - MSDN on where to store app data files: -# http://support.microsoft.com/default.aspx?scid=kb;en-us;310294#XSLTH3194121123120121120120 -# - Mac OS X: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/index.html -# - XDG spec for Un*x: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html +# - MSDN on where to store app data files: (TODO: needs new link) +# - macOS: (TODO: needs new link) +# - XDG spec for Un*x: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html __version_info__ = (1, 4, 3) __version__ = '.'.join(map(str, __version_info__)) @@ -64,7 +63,7 @@ def user_data_dir(appname=None, appauthor=None, version=None, roaming=False): for a discussion of issues. Typical user data directories are: - Mac OS X: ~/Library/Application Support/ + macOS: ~/Library/Application Support/ Unix: ~/.local/share/ # or in $XDG_DATA_HOME, if defined Win XP (not roaming): C:\Documents and Settings\\Application Data\\ Win XP (roaming): C:\Documents and Settings\\Local Settings\Application Data\\ @@ -118,7 +117,7 @@ def site_data_dir(appname=None, appauthor=None, version=None, multipath=False): if XDG_DATA_DIRS is not set Typical site data directories are: - Mac OS X: /Library/Application Support/ + macOS: /Library/Application Support/ Unix: /usr/local/share/ or /usr/share/ Win XP: C:\Documents and Settings\All Users\Application Data\\ Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) @@ -185,7 +184,7 @@ def user_config_dir(appname=None, appauthor=None, version=None, roaming=False): for a discussion of issues. Typical user config directories are: - Mac OS X: same as user_data_dir + macOS: same as user_data_dir Unix: ~/.config/ # or in $XDG_CONFIG_HOME, if defined Win *: same as user_data_dir @@ -223,7 +222,7 @@ def site_config_dir(appname=None, appauthor=None, version=None, multipath=False) returned, or '/etc/xdg/', if XDG_CONFIG_DIRS is not set Typical site config directories are: - Mac OS X: same as site_data_dir + macOS: same as site_data_dir Unix: /etc/xdg/ or $XDG_CONFIG_DIRS[i]/ for each value in $XDG_CONFIG_DIRS Win *: same as site_data_dir @@ -273,7 +272,7 @@ def user_cache_dir(appname=None, appauthor=None, version=None, opinion=True): discussion below. Typical user cache directories are: - Mac OS X: ~/Library/Caches/ + macOS: ~/Library/Caches/ Unix: ~/.cache/ (XDG default) Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Cache Vista: C:\Users\\AppData\Local\\\Cache @@ -333,7 +332,7 @@ def user_state_dir(appname=None, appauthor=None, version=None, roaming=False): for a discussion of issues. Typical user state directories are: - Mac OS X: same as user_data_dir + macOS: same as user_data_dir Unix: ~/.local/state/ # or in $XDG_STATE_HOME, if defined Win *: same as user_data_dir @@ -372,7 +371,7 @@ def user_log_dir(appname=None, appauthor=None, version=None, opinion=True): base cache dir for Unix. See discussion below. Typical user log directories are: - Mac OS X: ~/Library/Logs/ + macOS: ~/Library/Logs/ Unix: ~/.cache//log # or under $XDG_CACHE_HOME if defined Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Logs Vista: C:\Users\\AppData\Local\\\Logs diff --git a/pkg_resources/api_tests.txt b/pkg_resources/api_tests.txt index 7ae5a038..ded18800 100644 --- a/pkg_resources/api_tests.txt +++ b/pkg_resources/api_tests.txt @@ -290,8 +290,8 @@ Platform Compatibility Rules ---------------------------- On the Mac, there are potential compatibility issues for modules compiled -on newer versions of Mac OS X than what the user is running. Additionally, -Mac OS X will soon have two platforms to contend with: Intel and PowerPC. +on newer versions of macOS than what the user is running. Additionally, +macOS will soon have two platforms to contend with: Intel and PowerPC. Basic equality works as on other platforms:: diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 7a802413..0744ea2a 100644 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -1053,7 +1053,7 @@ def open_with_auth(url, opener=urllib.request.urlopen): parsed = urllib.parse.urlparse(url) scheme, netloc, path, params, query, frag = parsed - # Double scheme does not raise on Mac OS X as revealed by a + # Double scheme does not raise on macOS as revealed by a # failing test. We would expect "nonnumeric port". Refs #20. if netloc.endswith(':'): raise http_client.InvalidURL("nonnumeric port: ''") -- cgit v1.2.1 From 63b03e3610303163727308152590bcf78d5dc439 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Sat, 11 Apr 2020 18:16:22 +0000 Subject: news fragment --- changelog.d/2062.change.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/2062.change.rst diff --git a/changelog.d/2062.change.rst b/changelog.d/2062.change.rst new file mode 100644 index 00000000..1f5fd812 --- /dev/null +++ b/changelog.d/2062.change.rst @@ -0,0 +1 @@ +Change 'Mac OS X' to 'macOS' in code. -- cgit v1.2.1 From b36de51a8f36849b126ba46846cbddd00cd2ba8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 30 Apr 2020 10:19:03 +0200 Subject: Filter lib2to3 (Pending)DeprecationWarning in testes lib2to3 is deprecated in Python 3.9: https://bugs.python.org/issue40360 Workarounds https://github.com/pypa/setuptools/issues/2081 --- changelog.d/2082.misc.rst | 2 ++ pytest.ini | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 changelog.d/2082.misc.rst diff --git a/changelog.d/2082.misc.rst b/changelog.d/2082.misc.rst new file mode 100644 index 00000000..81ad5d58 --- /dev/null +++ b/changelog.d/2082.misc.rst @@ -0,0 +1,2 @@ +Filter ``lib2to3`` ``PendingDeprecationWarning`` and ``DeprecationWarning`` in testes, +because ``lib2to3`` is `deprecated in Python 3.9 `_. diff --git a/pytest.ini b/pytest.ini index b13b7f33..479a2965 100644 --- a/pytest.ini +++ b/pytest.ini @@ -20,3 +20,6 @@ filterwarnings = ignore:Unicode unequal comparison failed to convert:UnicodeWarning # https://github.com/pypa/setuptools/issues/2025 ignore:direct construction of .*Item has been deprecated:DeprecationWarning + # https://github.com/pypa/setuptools/issues/2081 + ignore:lib2to3 package is deprecated:PendingDeprecationWarning + ignore:lib2to3 package is deprecated:DeprecationWarning -- cgit v1.2.1 From d2a64aebe4fd7b02c9d05a0cac30faac38f18977 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 3 May 2020 05:51:59 -0400 Subject: Apply suggestions from code review --- changelog.d/1698.doc.rst | 2 +- docs/build_meta.txt | 42 +++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/changelog.d/1698.doc.rst b/changelog.d/1698.doc.rst index 9b61fccb..90dc14c1 100644 --- a/changelog.d/1698.doc.rst +++ b/changelog.d/1698.doc.rst @@ -1 +1 @@ -Added documentation for ``build_meta`` (a bare minimum, not completed) +Added documentation for ``build_meta`` (a bare minimum, not completed). diff --git a/docs/build_meta.txt b/docs/build_meta.txt index 4467ddda..67497891 100644 --- a/docs/build_meta.txt +++ b/docs/build_meta.txt @@ -1,5 +1,5 @@ ======================================= -Documentation to setuptools.build_meta +Build System Support ======================================= What is it? @@ -7,16 +7,18 @@ What is it? Python packaging has come `a long way `_. -The traditional ``setuptools``'s way of packgaging Python modules +The traditional ``setuptools`` way of packgaging Python modules uses a ``setup()`` function within the ``setup.py`` script. Commands such as ``python setup.py bdist`` or ``python setup.py bdist_wheel`` generate a distribution bundle and ``python setup.py install`` installs the distribution. This interface makes it difficult to choose other packaging tools without an -overhaul. Additionally, the ``setup.py`` scripts hasn't been the most user -friendly tool. +overhaul. Because ``setup.py`` scripts allowed for arbitrary execution, it +proved difficult to provide a reliable user experience across environments +and history. -PEP517 therefore came to rescue and specified a new standard to -package and distribute Python modules. Under PEP517: +`PEP 517 `_ therefore came to +rescue and specified a new standard to +package and distribute Python modules. Under PEP 517: a ``pyproject.toml`` file is used to specify what program to use for generating distribution. @@ -35,8 +37,8 @@ package and distribute Python modules. Under PEP517: With this standard, switching between packaging tools becomes a lot easier and in the case of ``setuptools``, ``setup.py`` becomes optional. -``build_meta`` is ``setuptools``'s implementation of PEP517. It provides the -two functions, ``build_wheel`` and ``build_sdist``, amongst others and uses +``build_meta`` is ``setuptools``'s implementation of PEP 517. It provides the +two functions, ``build_wheel`` and ``build_sdist`` amongst others, and uses a ``setup.cfg`` to specify the information about the package. How to use it? @@ -58,7 +60,7 @@ setuptools, the content would be:: requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" -``setup.cfg`` is used to specify your package information, specified +Use ``setup.cfg`` to specify your package information, specified `here `_ :: @@ -70,26 +72,24 @@ setuptools, the content would be:: [options] packages = find: -Now it's time to actually generate the distribution. PEP517 specifies two -mandatory functions, ``build_wheel`` and ``build_sdist``, implemented in -this module. Currently, it has to be done in the interpreter:: +Now generate the distribution. Although the PyPA is still working to +`provide a recommended tool `_ +to build packages, the `pep517 package >> import setuptools.build_meta - >>> setuptools.build_meta.build_wheel('wheel_dist') - 'meowpkg-0.0.1-py3-none-any.whl' - >>> setuptools.build_meta.build_sdist('sdist') - 'meowpkg-0.0.1.tar.gz' + $ pip install -q pep517 + $ mkdir dist + $ python -m pep517.build . And now it's done! The ``.whl`` file and ``.tar.gz`` can then be distributed and installed:: - ~/newcomputer/ + dist/ meowpkg-0.0.1.whl meowpkg-0.0.1.tar.gz - $ pip install meowpkg-0.0.1.whl + $ pip install dist/meowpkg-0.0.1.whl or:: - $ pip install meowpkg-0.0.1.tar.gz - + $ pip install dist/meowpkg-0.0.1.tar.gz -- cgit v1.2.1 From cc5b5ec305100ecd897edfc7918f184ffc93c197 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 3 May 2020 05:59:41 -0400 Subject: Apply suggestions from code review --- docs/build_meta.txt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/docs/build_meta.txt b/docs/build_meta.txt index 67497891..ef9fb2ac 100644 --- a/docs/build_meta.txt +++ b/docs/build_meta.txt @@ -34,12 +34,8 @@ package and distribute Python modules. Under PEP 517: ``pyproject.toml`` and decide what program to use to 'build from source' (the default is ``setuptools``) -With this standard, switching between packaging tools becomes a lot easier and -in the case of ``setuptools``, ``setup.py`` becomes optional. - -``build_meta`` is ``setuptools``'s implementation of PEP 517. It provides the -two functions, ``build_wheel`` and ``build_sdist`` amongst others, and uses -a ``setup.cfg`` to specify the information about the package. +With this standard, switching between packaging tools becomes a lot easier. ``build_meta`` +implements ``setuptools``' build system support. How to use it? -------------- @@ -60,9 +56,7 @@ setuptools, the content would be:: requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" -Use ``setup.cfg`` to specify your package information, specified -`here `_ :: +Use ``setuptools``' `declarative config`_ to specify the package information:: [metadata] name = meowpkg -- cgit v1.2.1 From 8c360dfd6361a15d1bbdfadb5fd0927a9a4a4cef Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 3 May 2020 06:30:31 -0400 Subject: Revert changes to historical notes and vendored packages. --- CHANGES.rst | 10 +++++----- pkg_resources/_vendor/appdirs.py | 21 +++++++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index c145eb39..ac61c178 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1519,7 +1519,7 @@ v21.1.0 * #572: In build_ext, now always import ``_CONFIG_VARS`` from ``distutils`` rather than from ``sysconfig`` to allow ``distutils.sysconfig.customize_compiler`` - configure the macOS compiler for ``-dynamiclib``. + configure the OS X compiler for ``-dynamiclib``. v21.0.0 ------- @@ -1939,7 +1939,7 @@ v20.6.0 require that Cython be present before building source distributions. However, for systems with this build of setuptools, Cython will be downloaded on demand. -* Issue #396: Fixed test failure on macOS. +* Issue #396: Fixed test failure on OS X. * BB Pull Request #136: Remove excessive quoting from shebang headers for Jython. @@ -3136,7 +3136,7 @@ how it parses version numbers. * Distribute #306: Even if 2to3 is used, we build in-place under Python 2. * Distribute #307: Prints the full path when .svn/entries is broken. * Distribute #313: Support for sdist subcommands (Python 2.7) -* Distribute #314: test_local_index() would fail an macOS. +* Distribute #314: test_local_index() would fail an OS X. * Distribute #310: Non-ascii characters in a namespace __init__.py causes errors. * Distribute #218: Improved documentation on behavior of `package_data` and `include_package_data`. Files indicated by `package_data` are now included @@ -4163,7 +4163,7 @@ easy_install based on a contribution by Kevin Dangoor. You may wish to delete and reinstall any eggs whose filename includes "darwin" and "Power_Macintosh", because the format for this platform information has changed so that minor - macOS upgrades (such as 10.4.1 to 10.4.2) do not cause eggs built with a + OS X upgrades (such as 10.4.1 to 10.4.2) do not cause eggs built with a previous OS version to become obsolete. * easy_install's dependency processing algorithms have changed. When using @@ -4176,7 +4176,7 @@ easy_install * Added ``--site-dirs`` option to allow adding custom "site" directories. Made ``easy-install.pth`` work in platform-specific alternate site - directories (e.g. ``~/Library/Python/2.x/site-packages`` on macOS). + directories (e.g. ``~/Library/Python/2.x/site-packages`` on Mac OS X). * If you manually delete the current version of a package, the next run of EasyInstall against the target directory will now remove the stray entry diff --git a/pkg_resources/_vendor/appdirs.py b/pkg_resources/_vendor/appdirs.py index 4552cbbf..ae67001a 100644 --- a/pkg_resources/_vendor/appdirs.py +++ b/pkg_resources/_vendor/appdirs.py @@ -8,9 +8,10 @@ See for details and usage. """ # Dev Notes: -# - MSDN on where to store app data files: (TODO: needs new link) -# - macOS: (TODO: needs new link) -# - XDG spec for Un*x: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html +# - MSDN on where to store app data files: +# http://support.microsoft.com/default.aspx?scid=kb;en-us;310294#XSLTH3194121123120121120120 +# - Mac OS X: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/index.html +# - XDG spec for Un*x: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html __version_info__ = (1, 4, 3) __version__ = '.'.join(map(str, __version_info__)) @@ -63,7 +64,7 @@ def user_data_dir(appname=None, appauthor=None, version=None, roaming=False): for a discussion of issues. Typical user data directories are: - macOS: ~/Library/Application Support/ + Mac OS X: ~/Library/Application Support/ Unix: ~/.local/share/ # or in $XDG_DATA_HOME, if defined Win XP (not roaming): C:\Documents and Settings\\Application Data\\ Win XP (roaming): C:\Documents and Settings\\Local Settings\Application Data\\ @@ -117,7 +118,7 @@ def site_data_dir(appname=None, appauthor=None, version=None, multipath=False): if XDG_DATA_DIRS is not set Typical site data directories are: - macOS: /Library/Application Support/ + Mac OS X: /Library/Application Support/ Unix: /usr/local/share/ or /usr/share/ Win XP: C:\Documents and Settings\All Users\Application Data\\ Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) @@ -184,7 +185,7 @@ def user_config_dir(appname=None, appauthor=None, version=None, roaming=False): for a discussion of issues. Typical user config directories are: - macOS: same as user_data_dir + Mac OS X: same as user_data_dir Unix: ~/.config/ # or in $XDG_CONFIG_HOME, if defined Win *: same as user_data_dir @@ -222,7 +223,7 @@ def site_config_dir(appname=None, appauthor=None, version=None, multipath=False) returned, or '/etc/xdg/', if XDG_CONFIG_DIRS is not set Typical site config directories are: - macOS: same as site_data_dir + Mac OS X: same as site_data_dir Unix: /etc/xdg/ or $XDG_CONFIG_DIRS[i]/ for each value in $XDG_CONFIG_DIRS Win *: same as site_data_dir @@ -272,7 +273,7 @@ def user_cache_dir(appname=None, appauthor=None, version=None, opinion=True): discussion below. Typical user cache directories are: - macOS: ~/Library/Caches/ + Mac OS X: ~/Library/Caches/ Unix: ~/.cache/ (XDG default) Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Cache Vista: C:\Users\\AppData\Local\\\Cache @@ -332,7 +333,7 @@ def user_state_dir(appname=None, appauthor=None, version=None, roaming=False): for a discussion of issues. Typical user state directories are: - macOS: same as user_data_dir + Mac OS X: same as user_data_dir Unix: ~/.local/state/ # or in $XDG_STATE_HOME, if defined Win *: same as user_data_dir @@ -371,7 +372,7 @@ def user_log_dir(appname=None, appauthor=None, version=None, opinion=True): base cache dir for Unix. See discussion below. Typical user log directories are: - macOS: ~/Library/Logs/ + Mac OS X: ~/Library/Logs/ Unix: ~/.cache//log # or under $XDG_CACHE_HOME if defined Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Logs Vista: C:\Users\\AppData\Local\\\Logs -- cgit v1.2.1 From 194ae0ee00f16cf6a30202ef1f35237f730f4b21 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 3 May 2020 07:33:04 -0400 Subject: Update template to give more guidance, hoping to limit the blank submissions. --- .../setuptools-warns-about-python-2-incompatibility.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/setuptools-warns-about-python-2-incompatibility.md b/.github/ISSUE_TEMPLATE/setuptools-warns-about-python-2-incompatibility.md index 14317d93..2f5fe53d 100644 --- a/.github/ISSUE_TEMPLATE/setuptools-warns-about-python-2-incompatibility.md +++ b/.github/ISSUE_TEMPLATE/setuptools-warns-about-python-2-incompatibility.md @@ -9,6 +9,10 @@ assignees: '' ## Environment Details - Operating System and version: -- Python version: -- Python installed how: +- Python version: +- Python installed how: - Virtualenv version (if using virtualenv): n/a Command(s) used to install setuptools (and output): -- cgit v1.2.1 From 40f81af021b899b76b96eef52bf020c2348e1aea Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 3 May 2020 07:40:44 -0400 Subject: Remove shebang. Fixes #2076. --- setuptools/command/easy_install.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 64ff0457..5a9576ff 100644 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python """ Easy Install ------------ -- cgit v1.2.1 From 61ca49c08e71fee962b760fb90f8f89bb158738b Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Thu, 7 May 2020 11:39:55 -0400 Subject: Tweak note about setup.cfg This note has gotten a bit out of date, since setup.py is no longer required. --- docs/setuptools.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 22e3c872..30a30c26 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -2106,8 +2106,9 @@ Configuring setup() using setup.cfg files .. note:: New in 30.3.0 (8 Dec 2016). .. important:: - A ``setup.py`` file containing a ``setup()`` function call is still - required even if your configuration resides in ``setup.cfg``. + If compatibility with legacy builds (i.e. those not using the :pep:`517` + build API) is desired, a ``setup.py`` file containing a ``setup()`` function + call is still required even if your configuration resides in ``setup.cfg``. ``Setuptools`` allows using configuration files (usually :file:`setup.cfg`) to define a package’s metadata and other options that are normally supplied -- cgit v1.2.1 From 2d607a9e59aa854b387f22d79301acb8739b133a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 10 May 2020 13:19:52 -0400 Subject: Emit deprecation warning when 2to3 is used. Ref #2086. --- setuptools/lib2to3_ex.py | 7 +++++++ setuptools/tests/test_test.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/setuptools/lib2to3_ex.py b/setuptools/lib2to3_ex.py index 4b1a73fe..817dce40 100644 --- a/setuptools/lib2to3_ex.py +++ b/setuptools/lib2to3_ex.py @@ -7,6 +7,7 @@ Customized Mixin2to3 support: This module raises an ImportError on Python 2. """ +import warnings from distutils.util import Mixin2to3 as _Mixin2to3 from distutils import log from lib2to3.refactor import RefactoringTool, get_fixers_from_package @@ -33,6 +34,12 @@ class Mixin2to3(_Mixin2to3): return if not files: return + + warnings.warn( + "2to3 support is deprecated. Please migrate to " + "a single-codebase solution or roll your own " + "conversion process.", + DeprecationWarning) log.info("Fixing " + " ".join(files)) self.__build_fixer_names() self.__exclude_fixers() diff --git a/setuptools/tests/test_test.py b/setuptools/tests/test_test.py index 8ee70a7e..0f77d8ff 100644 --- a/setuptools/tests/test_test.py +++ b/setuptools/tests/test_test.py @@ -73,7 +73,11 @@ def quiet_log(): log.set_verbosity(0) +ack_2to3 = pytest.mark.filterwarnings('ignore:2to3 support is deprecated') + + @pytest.mark.usefixtures('sample_test', 'quiet_log') +@ack_2to3 def test_test(capfd): params = dict( name='foo', @@ -124,6 +128,7 @@ def test_tests_are_run_once(capfd): @pytest.mark.usefixtures('sample_test') +@ack_2to3 def test_warns_deprecation(capfd): params = dict( name='foo', @@ -149,6 +154,7 @@ def test_warns_deprecation(capfd): @pytest.mark.usefixtures('sample_test') +@ack_2to3 def test_deprecation_stderr(capfd): params = dict( name='foo', -- cgit v1.2.1 From b286525862fa0a4839f37b5836a20178293d7335 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 10 May 2020 13:27:50 -0400 Subject: Update changelog. --- changelog.d/2086.change.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/2086.change.rst diff --git a/changelog.d/2086.change.rst b/changelog.d/2086.change.rst new file mode 100644 index 00000000..9fa54e5a --- /dev/null +++ b/changelog.d/2086.change.rst @@ -0,0 +1 @@ +Deprecate 'use_2to3' functionality. Packagers are encouraged to use single-source solutions or build tool chains to manage conversions outside of setuptools. -- cgit v1.2.1 From 0fffb84a1bc7925fbf862365787ab20e9ab89a0c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 10 May 2020 14:03:30 -0400 Subject: In the deprecation warning, acknowledge that it's only for projects that still require Python 2 support. --- setuptools/lib2to3_ex.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setuptools/lib2to3_ex.py b/setuptools/lib2to3_ex.py index 817dce40..6d9b147c 100644 --- a/setuptools/lib2to3_ex.py +++ b/setuptools/lib2to3_ex.py @@ -36,9 +36,10 @@ class Mixin2to3(_Mixin2to3): return warnings.warn( - "2to3 support is deprecated. Please migrate to " - "a single-codebase solution or roll your own " - "conversion process.", + "2to3 support is deprecated. If the project still " + "requires Python 2 support, please migrate to " + "a single-codebase solution or employ an " + "independent conversion process.", DeprecationWarning) log.info("Fixing " + " ".join(files)) self.__build_fixer_names() -- cgit v1.2.1 From a354d7bc1b7737fc1b4a9d238a247364035ab3d8 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 10 May 2020 14:23:10 -0400 Subject: Use the SetuptoolsDeprecationWarning to make the warning more visible outside test runners. --- setuptools/lib2to3_ex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setuptools/lib2to3_ex.py b/setuptools/lib2to3_ex.py index 6d9b147c..017f7285 100644 --- a/setuptools/lib2to3_ex.py +++ b/setuptools/lib2to3_ex.py @@ -13,6 +13,7 @@ from distutils import log from lib2to3.refactor import RefactoringTool, get_fixers_from_package import setuptools +from ._deprecation_warning import SetuptoolsDeprecationWarning class DistutilsRefactoringTool(RefactoringTool): @@ -40,7 +41,7 @@ class Mixin2to3(_Mixin2to3): "requires Python 2 support, please migrate to " "a single-codebase solution or employ an " "independent conversion process.", - DeprecationWarning) + SetuptoolsDeprecationWarning) log.info("Fixing " + " ".join(files)) self.__build_fixer_names() self.__exclude_fixers() -- cgit v1.2.1