Commit Graph

3145 Commits

Author SHA1 Message Date
Jason R. Coombs 37d617cd98 Extract _resolve 2019-10-27 20:40:07 -04:00
Jason R. Coombs 773f1ec3c2 Rely on contextlib.closing for brevity. 2019-10-27 20:25:21 -04:00
Jason R. Coombs 85a9ca5e75 Extract 'imp' re-implementation to setuptools._imp and wrap it in py27compat for compatibility. 2019-10-27 20:25:17 -04:00
Jason R. Coombs f430e585d8 Remove apparently unrelated change to test 2019-10-27 19:16:36 -04:00
Jason R. Coombs e3068ee28f
Merge pull request #1824 from asottile/python310
Fixes for python3.10
2019-10-27 18:17:30 -04:00
Jason R. Coombs 230d1f74ee
Merge pull request #1811 from JGoutin/msvc_update
Improve Visual C++ 14.X support
2019-10-27 08:54:52 -04:00
Jon Dufresne 4069e0b536 Remove outdated comment and suppressed exception from test_test.py
The test command has not called sys.exit since commit
2c4fd43277.
2019-10-22 23:15:40 +09:00
Paul Ganssle e81a201370
Merge pull request #1881 from jdufresne/utf-8
Change coding cookie to use utf-8 (lowercase)
2019-10-22 10:02:01 -04:00
Jon Dufresne cd84510713 Deprecate the test command
Provide a warning to users. Suggest using tox as an alternative generic
entry point.

Refs #1684
2019-10-21 17:32:25 -07:00
Jon Dufresne d89682fcba Change coding cookie to use utf-8 (lowercase)
While perfectly valid, the encoding 'UTF-8' (uppercase) is not
recognized by the Emacs MULE system. As such, it displays the following
warning when opening a file with it used as an encoding cookie:

    Warning (mule): Invalid coding system ‘UTF-8’ is specified
    for the current buffer/file by the :coding tag.
    It is highly recommended to fix it before writing to a file.

Some discussion of this can be found at:

https://stackoverflow.com/questions/14031724/how-to-make-emacs-accept-utf-8-uppercase-encoding

While the post does offer a workaround for Emacs users, rather than ask
all to implement it, use the more typical utf-8 (lowercase).
2019-10-21 16:55:38 -07:00
Jason R. Coombs 4c22a6ca57 Add new hook 'setuptools.finalize_distribution_options' for plugins like 'setuptools_scm' to alter distribution options. 2019-10-18 20:37:42 -04:00
isidentical 1410d87f8a Upgrade setuptools.depends to importlib from depracated imp 2019-10-13 11:44:42 +03:00
Benoit Pierre 3d811b93a8 wheel: switch to `packaging.tags` for checking PEP 425 tags 2019-10-07 23:32:58 +02:00
Benoit Pierre bf069fe9dd setuptools: update vendored packaging 2019-10-07 23:32:58 +02:00
Benoit Pierre cb8769d7d1 minor cleanup 2019-10-07 23:19:23 +02:00
Benoit Pierre 16a3ef93fc wheel: fix installation of empty namespace package 2019-10-07 23:05:15 +02:00
Benoit Pierre d7810a9013 wheel: silence info trace when writing `requires.txt` 2019-10-07 22:58:14 +02:00
Jason R. Coombs 734d09c5a3 Pin ordered-set to current version for consistency. 2019-10-07 16:36:54 -04:00
Jason R. Coombs 01bf4fb2b1
Merge pull request #1847 from pypa/bugfix/1787-python-requires-invalid
Crash when invalid python_requires indicated in setup.cfg
2019-10-06 21:29:51 -04:00
Jason R. Coombs 53d662a9de Allow 'long_description_content_type' warnings for new versions of packaging. Fixes #1858. 2019-10-06 21:21:17 -04:00
Jason R. Coombs 6f962a07f5 Refresh vendored packages (ordereddict 3.1.1) 2019-10-06 20:42:14 -04:00
Jason R. Coombs b3ef77b208
Merge branch 'master' into feature/deterministic-provides-extras 2019-09-11 18:07:45 +01:00
Jason R. Coombs c3df086ed3 Ensure that python_requires is checked during option processing. Fixes #1787. 2019-09-11 16:54:07 +01:00
Jason R. Coombs b31777cd50 Add more tests for valid behavior. Expand exception, any should do. 2019-09-11 16:52:58 +01:00
Jason R. Coombs ca0ee009f8 Add test capturing failure. Ref #1787. 2019-09-11 16:39:57 +01:00
Anthony Sottile 43add1d3f5 Fixes for python3.10 2019-08-17 19:18:07 -07:00
Anthony Sottile eb7436b36f Fix some usage of deprecated `imp` module 2019-08-17 14:29:21 -07:00
jgoutin 7e1b1934c7 Improve Visual C++ 14.X support
Improve VC++14 support for VS 2017 and 2019.
Separate VC from VS version (Miss match starting VS15).
Improve docstrings args and returns information + fixe typos.
Fix coding style and minor coding issues.
Remove Microsoft "Windows SDK 7.0" dead link.
2019-08-03 10:56:51 +02:00
Benoit Pierre d694f54455 tests: fix `test_pip_upgrade_from_source` on Python 3.4
Do not test pip's master on 3.4, as support for it has been dropped.
2019-07-23 11:29:21 +02:00
Daniel Himmelstein 8f848bd777 improve `package_data` check
Ensure the dictionary values are lists/tuples of strings.

Fix #1459.
2019-07-16 13:20:36 +02:00
Daniel Himmelstein 305bb1cefc fix assert_string_list docstring
value=None raises TypeError

DistutilsSetupError: 2 must be a list of strings (got None)
2019-07-16 12:46:59 +02:00
Inada Naoki 53b8db3593 Stop using deprecated HTMLParser.unescape
HTMLParser.unescape is accessed even when unused - this will cause an
exception when `HTMLParser.unescape` is removed in Python 3.9.
2019-06-19 10:15:58 -04:00
Bastian Venthur a64ddf0d2f Added test for metadata-version 1.2 2019-05-16 13:48:15 +02:00
Bastian Venthur 880ff4a357 Force metadata-version = 1.2 when project urls are present.
Closes: #1756
2019-05-16 12:46:50 +02:00
Emiel Wiedijk b2701fb392 Add tests 2019-05-15 20:00:31 +02:00
Emiel Wiedijk 8f227af516 Set sys.argv[0] in build scripts run by build_meta
Some setup.py scripts, use sys.argv[0] to locate the source directory of
a project. I added this to build_meta.__legacy__ since that is focused
on backwards compatibility with old scripts. However, @pganssle said
this behaviour should not be added to setuptools.build_meta. Fixes #1628
2019-05-15 19:56:15 +02:00
Benoit Pierre f58549ab38 tests: fix_test_build_deps_on_distutils
* ignore distutils' warning (`Unknown distribution option: 'python_requires'`)
* fix test on Windows
2019-05-14 15:48:38 +02:00
Benoit Pierre 5f88c42f3b build_meta: fix 2 issues with `build_wheel` / `build_sdist`
Fix the following cases:

* `build_sdist` is called with another sdist already present
  in the destination directory

* `build_wheel` is called with the destination directory not
  already created
2019-04-22 23:02:33 +02:00
Paul Ganssle 50a41c7005
Merge pull request #1745 from shashanksingh28/master
Fix error with PEP 517 builds when wheel exists (GH #1761)
2019-04-22 11:52:09 -04:00
Paul Ganssle 127c8c74de
Limit workers in ProcessPoolExecutor
As a mitigation for #1730, this commit limits the number of workers in
the ProcessPoolExecutor to 1 (default is the number of CPUs). On PyPy,
having a higher number of available workers dramatically increases the
number of concurrent processes, leading to some resource exhaustion
issues.

This does not address the root issue, but should improve the situation
until the root issue is addressed.
2019-04-22 11:17:21 -04:00
Shashank Singh 901f7cc2a0 Fix error when wheels already exist in dist/
`build_meta.build_wheel` assumes that the only wheel in its output
directory is the one it builds, but prior to this, it also used the
`dist/` folder as its working output directory. This commit uses a
temporary directory instead, preventing an error that was triggered when
previously-generated wheel files were still sitting in `dist/`.

Fixes GH #1671
2019-04-22 10:19:28 -04:00
Floris Lambrechts 869c634880
Add test for pre-existing wheels in build_meta
Currently, this will fail because setuptools.build_meta.build_wheel
assumes that no wheels already exist in the `dist/` directory.

See GH #1671
2019-04-20 20:16:55 -04:00
2xB 0259db3b7a
Updated test to check for changed git rev checkout
Checking for new implementation solving issue #1740
2019-04-12 01:10:33 +02:00
2xB 59aeb62614
FIX: git and hg revision checkout under Windows
Windows does not change the working directory for a process via `cd .. && <process>` (see e.g. this question: https://stackoverflow.com/q/55641332/8575607 ). This commit replaces the use of `cd .. &&` with arguments provided by `git` and `hg` respectively.
2019-04-12 00:32:12 +02:00
Jason R. Coombs 7326bdfa8c
Merge pull request #1709 from radiasoft/master
uniquify paths in PYTHONPATH
2019-04-05 15:17:39 -04:00
Jason R. Coombs 8db41e478d Rely on unique_everseen to avoid unnecessarily polluting the PYTHONPATH with duplicate entries. 2019-04-05 15:12:21 -04:00
Jason R. Coombs f36781084f Remove detect_encoding, no longer used. 2019-04-05 12:25:03 -04:00
Jason R. Coombs 7ed188bcaf Correct cyrillic to match preferred pronunciation. 2019-04-05 11:07:02 -04:00
Jason R. Coombs b336e83a63 Add compatibility for Python 2 2019-04-05 10:49:23 -04:00
Jason R. Coombs 7b09ba64c0 Add test for setopt to demonstrate that edit_config retains non-ASCII characters. 2019-04-05 10:46:00 -04:00
Jason R. Coombs 85fa4a6bc5 When reading config files, require them to be encoded with UTF-8. Fixes #1702. 2019-04-05 10:30:47 -04:00
Jason R. Coombs 393809a02e Feed the hobgoblins (delint). 2019-04-05 09:27:23 -04:00
Paul Ganssle 4cd3da0490
Merge pull request #1720 from pganssle/fix_setup_meta
Support requirement parsing in setuptools.build_meta
2019-03-16 15:23:38 -04:00
Paul Ganssle 5efdf816fd
Use pkg_resources.parse_requirements in build_meta
Since pkg_resources is imported elsewhere anyway, we don't get much
value out of porting the requirement parser locally.
2019-03-16 15:10:55 -04:00
Dustin Ingram c27c705f6a Fix typo in docstring (#1718) 2019-03-16 13:06:53 -04:00
Paul Ganssle b54d4c699f
Extend requirement parsing tests to sdists 2019-03-16 12:58:29 -04:00
Paul Ganssle 318f739d14
Add requirement parsing in setuptools.build_meta
This fixes GH #1682 by porting the pkg_resources requirement parsing
logic into setuptools.build_meta, so that all valid requirement
specifiers passed to setup_requires will be added to the
get_requires_for_build_* function outputs.

Fixes GH #1682
2019-03-16 12:58:29 -04:00
Paul Ganssle 1aa781cd8e
Add failing test for setup_requires
Per GH #1682, with setuptools.build_meta we are not properly handling
the situation where setup_requires is actually a newline-delimited
string rather than a list, which is supported by setup.py interface.

This adds several failing (and some passing) tests for how
setup_requires is handled by setuptools.build_meta.
2019-03-16 12:58:29 -04:00
Frédéric Chapoton 16e452a42a Remove duplicate import io (#1713)
Found by lgtm
2019-03-06 09:22:28 -05:00
robnagler 5b2175ebd9 uniquify paths in PYTHONPATH
When running in a complex environment with lots of installed
packages, PYTHONPATH gets way too long. Instead, just make sure
that paths_on_pythonpath doesn't contain duplicates
2019-02-26 17:10:49 +00:00
Paul Ganssle b224605a8c
Automatically skip tests that require network 2019-02-23 11:38:50 -06:00
Benoit Pierre 82db4c6219 tests: improve `test_pip_upgrade_from_source`
Parametrize the test to check different versions of pip
(including master) are correctly supported.
2019-02-22 19:39:27 -06:00
Jason R. Coombs 7f7780e5b5 In tests, force deterministic ordering on extras_require so tests pass. 2019-02-17 17:37:40 -05:00
Jason R. Coombs 636070d992 Use an ordered set when constructing 'extras provided'. Ref #1305. 2019-02-17 17:09:26 -05:00
Jason R. Coombs 3d289a7015 Add 'ordered_set' as a vendored package 2019-02-17 17:08:40 -05:00
Jason R. Coombs 4a6b8ba7ce Add test capturing expectation that provides_extras are ordered. 2019-02-17 17:08:13 -05:00
Paul Ganssle 179115b198
Add support for setup.cfg-only projects
Many projects can get away with an empty `setup.py` and use *only* the
declarative `setup.cfg`. With the new PEP 517 backend, we can supply a
default empty `setup.py` if one is not provided.
2019-02-07 08:08:14 -05:00
Paul Ganssle e04a41e312
Rename build_meta:legacy to build_meta:__legacy__ 2019-02-05 08:42:36 -05:00
Paul Ganssle 11fb3f38d2
Move build_meta_legacy to build_meta:legacy
Rather than exposing a top-level module for the legacy backend, we will
move the legacy backend into the `setuptools.build_meta` module and
specify it using the module:object syntax.
2019-02-03 12:25:06 -05:00
Paul Ganssle db590baf81
Use absolute path in build_meta_legacy
Using the absolute path to the directory of the setup script better
mimics the semantics of a direct invocation of python setup.py.
2019-02-03 12:25:06 -05:00
Paul Ganssle 49d17725a0
Set sys.path in try/finally block with comment
Per Nick Coghlan's suggestion on PR #1652, a try/finally block ensures
that the path is restored even in the event of an error.
2019-02-03 12:25:06 -05:00
Paul Ganssle fd3b06dae1
Add build_meta_legacy backend
This is part of the solution to GH #1642, it is a
backwards-compatibility backend that can be used as a default PEP 517
backend for projects that use setuptools but haven't opted in to
build_meta.
2019-02-03 12:25:06 -05:00
Paul Ganssle a114112ea5
Add failing test suite for build_meta_legacy
This runs all build_meta tests, plus a test that it is possible to
import from the directory containing `setup.py` when using the
build_meta_legacy backend.
2019-02-03 12:25:05 -05:00
Paul Ganssle bd800f4c79
Add test for relative path imports in build_meta
Failing test adapted from PR #1643

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
2019-02-03 12:25:05 -05:00
Paul Ganssle 6d0daf1427
Wrap build_meta tests in a reusable test class 2019-02-03 12:25:05 -05:00
Paul Ganssle f40a47a776
Add __all__ to setuptools.build_meta 2019-02-03 12:25:05 -05:00
Paul Ganssle 74c323d165
Wrap build_meta backend in a class
In order to support both the `build_meta` and `build_meta_legacy`
backends, the core functionality is wrapped in a class with methods to
be overridden in build_meta_legacy. The class is an implementation
detail and should remain private.
2019-02-03 12:25:05 -05:00
Jason R. Coombs 16ee30601f Merge tag 'v40.7.3'
Bump version: 40.7.2 → 40.7.3
2019-02-03 10:26:00 -05:00
Jason R. Coombs be840c2fe4 Also restore port consideration when re-injecting credentials for found links. 2019-02-03 10:17:02 -05:00
Jason R. Coombs 0830a69efd Revert to using a copy of splituser from Python 3.8. Using urllib.parse.urlparse is clumsy and causes problems as reported in #1663 and #1668. Alternative to #1499 and fixes #1668. 2019-02-03 09:22:19 -05:00
Jason R. Coombs f379036fbc
Merge pull request #1665 from pypa/bugfix/1663-restore-port
Ensure port is included in package-index
2019-01-31 20:54:33 -05:00
Jason R. Coombs 260bbe545e Ensure a specified port in package_index isn't lost in the parse/unparse of the URL when auth is present. Fixes #1663. 2019-01-31 20:46:48 -05:00
Jason R. Coombs 8f82e5077e Merge branch '40.7-maintenance' 2019-01-28 19:09:14 -05:00
Jason R. Coombs 9150b6b727 Prefer native strings on Python 2 when reading config files. Fixes #1653. 2019-01-28 18:09:50 -05:00
Benoit Pierre f7447817b6 test: add a simple regression test for `build_ext` 2019-01-28 18:04:29 -05:00
Benoit Pierre 3ac3b67e2c tests: minor cleanup 2019-01-28 23:04:09 +01:00
Jason R. Coombs 0551421f08
Merge branch 'master' into license-fix-357 2019-01-27 10:02:52 -05:00
Jason R. Coombs b31997dbcd
Merge pull request #1180 from benoit-pierre/fix_889_and_non-ascii_in_setup.cfg_take_2
improve encoding handling for `setup.cfg`
2019-01-27 09:11:50 -05:00
Jason R. Coombs 249f24a1f0 Fix test failure by better detecting string options from an updated ConfigParser. 2019-01-26 21:48:38 -05:00
Jason R. Coombs b1615d1243 Adopt distutils.dist.Distribution._set_command_options to support better string detection. 2019-01-26 21:45:33 -05:00
Jason R. Coombs 5cd8698753 Feed the hobgoblins (delint). 2019-01-26 20:34:00 -05:00
Jason R. Coombs 24be5abd4c Given that the config file parsing functionality is unlikely to change upstream, just incorporate the functionality directly. 2019-01-25 16:11:07 -05:00
Jason R. Coombs 992aa3dfba Merge branch 'master' into fix_889_and_non-ascii_in_setup.cfg_take_2 2019-01-25 15:49:59 -05:00
Alexander Duryagin d53e024af2 do not change py36compat, put changes into sdist command 2019-01-11 15:57:54 +03:00
Alexander Duryagin 0c79e4d09c include pyproject.toml in sdist (#1632) 2019-01-11 15:29:40 +03:00
Jason R. Coombs f8ff0d0d46 Feed the hobgoblins (delint). 2019-01-08 14:42:27 -05:00
Jason R. Coombs c688982505 Feed the hobgoblins (delint). 2019-01-08 14:41:02 -05:00
Jason R. Coombs 572fb158a4
Merge pull request #1625 from pypa/bugfix/1623-always-targz
In build_meta (PEP 517), always built gztar
2019-01-03 08:06:58 -05:00
Jason R. Coombs 2bb8225a6e Extract common behavior into a function 2019-01-02 14:42:23 -05:00
Jason R. Coombs 7378e6be2f Avoid hanging indent 2019-01-02 14:39:37 -05:00