Skip to content

Commit

Permalink
Vendor setuptools_scm instead of declaring it to avoid bootstrapping …
Browse files Browse the repository at this point in the history
…issue.
  • Loading branch information
jaraco committed Jul 31, 2024
1 parent cd9139e commit 2faa82c
Show file tree
Hide file tree
Showing 41 changed files with 3,504 additions and 1 deletion.
1 change: 1 addition & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def pytest_configure(config):
'setuptools/_distutils',
'_distutils_hack',
'pkg_resources/tests/data',
'setuptools/_build_vendor',
'setuptools/_vendor',
'setuptools/config/_validate_pyproject',
'setuptools/modified.py',
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools_scm[toml]>=3.4.1"]
requires = []
build-backend = "setuptools.build_meta"
backend-path = ["."]

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

here = os.path.dirname(__file__)

sys.path.extend(((vendor_path := os.path.join(os.path.dirname(__file__), 'setuptools', '_build_vendor')) not in sys.path) * [vendor_path]) # fmt: skip

package_data = dict(
setuptools=['script (dev).tmpl', 'script.tmpl', 'site-patch.py'],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip
17 changes: 17 additions & 0 deletions setuptools/_build_vendor/setuptools_scm-8.1.0.dist-info/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
166 changes: 166 additions & 0 deletions setuptools/_build_vendor/setuptools_scm-8.1.0.dist-info/METADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
Metadata-Version: 2.1
Name: setuptools-scm
Version: 8.1.0
Summary: the blessed package to manage your versions by scm tags
Author-email: Ronny Pfannschmidt <[email protected]>
License: Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Project-URL: documentation, https://setuptools-scm.readthedocs.io/
Project-URL: repository, https://github.com/pypa/setuptools_scm/
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Version Control
Classifier: Topic :: System :: Software Distribution
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: packaging >=20
Requires-Dist: setuptools
Requires-Dist: typing-extensions ; python_version < "3.10"
Requires-Dist: tomli >=1 ; python_version < "3.11"
Provides-Extra: docs
Requires-Dist: entangled-cli ~=2.0 ; extra == 'docs'
Requires-Dist: mkdocs ; extra == 'docs'
Requires-Dist: mkdocs-entangled-plugin ; extra == 'docs'
Requires-Dist: mkdocs-material ; extra == 'docs'
Requires-Dist: mkdocstrings[python] ; extra == 'docs'
Requires-Dist: pygments ; extra == 'docs'
Provides-Extra: rich
Requires-Dist: rich ; extra == 'rich'
Provides-Extra: test
Requires-Dist: build ; extra == 'test'
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: rich ; extra == 'test'
Requires-Dist: wheel ; extra == 'test'
Requires-Dist: typing-extensions ; (python_version < "3.11") and extra == 'test'
Provides-Extra: toml

# setuptools_scm
[![github ci](https://github.com/pypa/setuptools_scm/workflows/python%20tests+artifacts+release/badge.svg)](https://github.com/pypa/setuptools_scm/actions)
[![Documentation Status](https://readthedocs.org/projects/setuptools-scm/badge/?version=latest)](https://setuptools-scm.readthedocs.io/en/latest/?badge=latest)
[![tidelift](https://tidelift.com/badges/package/pypi/setuptools-scm) ](https://tidelift.com/subscription/pkg/pypi-setuptools-scm?utm_source=pypi-setuptools-scm&utm_medium=readme)

## about

[setuptools-scm] extracts Python package versions from `git` or
`hg` metadata instead of declaring them as the version argument
or in an SCM managed file.

Additionally, [setuptools-scm] provides setuptools
with a list of files that are managed by the SCM <br/>
(i.e. it automatically adds **all of** the SCM-managed files to the sdist).<br/>
Unwanted files must be excluded via `MANIFEST.in`.


## `pyproject.toml` usage

The preferred way to configure [setuptools-scm] is to author
settings in a `tool.setuptools_scm` section of `pyproject.toml`.

This feature requires setuptools 61 or later.
First, ensure that [setuptools-scm] is present during the project's
build step by specifying it as one of the build requirements.

```toml title="pyproject.toml"
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"
```

That will be sufficient to require [setuptools-scm] for projects
that support [PEP 518] like [pip] and [build].

[pip]: https://pypi.org/project/pip
[build]: https://pypi.org/project/build
[PEP 518]: https://peps.python.org/pep-0518/


To enable version inference, you need to set the version
dynamically in the `project` section of `pyproject.toml`:

```toml title="pyproject.toml"
[project]
# version = "0.0.1" # Remove any existing version parameter.
dynamic = ["version"]

[tool.setuptools_scm]
```

Additionally, a version file can be written by specifying:

```toml title="pyproject.toml"
[tool.setuptools_scm]
version_file = "pkg/_version.py"
```

Where `pkg` is the name of your package.

If you need to confirm which version string is being generated or debug the configuration,
you can install [setuptools-scm] directly in your working environment and run:

```console
$ python -m setuptools_scm
# To explore other options, try:
$ python -m setuptools_scm --help
```

For further configuration see the [documentation].

[setuptools-scm]: https://github.com/pypa/setuptools_scm
[documentation]: https://setuptools-scm.readthedocs.io/


## Interaction with Enterprise Distributions

Some enterprise distributions like RHEL7
ship rather old setuptools versions.

In those cases its typically possible to build by using an sdist against `setuptools_scm<2.0`.
As those old setuptools versions lack sensible types for versions,
modern [setuptools-scm] is unable to support them sensibly.

It's strongly recommended to build a wheel artifact using modern Python and setuptools,
then installing the artifact instead of trying to run against old setuptools versions.


## Code of Conduct


Everyone interacting in the [setuptools-scm] project's codebases, issue
trackers, chat rooms, and mailing lists is expected to follow the
[PSF Code of Conduct].

[PSF Code of Conduct]: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md


## Security Contact

To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure.
67 changes: 67 additions & 0 deletions setuptools/_build_vendor/setuptools_scm-8.1.0.dist-info/RECORD
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
setuptools_scm-8.1.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
setuptools_scm-8.1.0.dist-info/LICENSE,sha256=iYB6zyMJvShfAzQE7nhYFgLzzZuBmhasLw5fYP9KRz4,1023
setuptools_scm-8.1.0.dist-info/METADATA,sha256=JstkuN1RJAjyijO1FYrd2ZfrphMgbl-j1LyiGmVbzrQ,6614
setuptools_scm-8.1.0.dist-info/RECORD,,
setuptools_scm-8.1.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
setuptools_scm-8.1.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
setuptools_scm-8.1.0.dist-info/entry_points.txt,sha256=7VjBrJmw12qwaWG0yLbRs5fYIf7g4ySdOwHNsJMhy4A,1776
setuptools_scm-8.1.0.dist-info/top_level.txt,sha256=kiu-91q3_rJLUoc2wl8_lC4cIlpgtgdD_4NaChF4hOA,15
setuptools_scm/.git_archival.txt,sha256=2_90kdS1POSQMuZfBCUw6qNjObu7Ijp8DmptEAmlGkU,102
setuptools_scm/__init__.py,sha256=k4jjJK8ejFI95amIoLWNCFECWIQW9NlxF9Had4RqOHM,785
setuptools_scm/__main__.py,sha256=AhntzdNH3Jhcio_Ohoc6_EW7CuIN02OM-0irpGEXXh0,116
setuptools_scm/__pycache__/__init__.cpython-312.pyc,,
setuptools_scm/__pycache__/__main__.cpython-312.pyc,,
setuptools_scm/__pycache__/_cli.cpython-312.pyc,,
setuptools_scm/__pycache__/_config.cpython-312.pyc,,
setuptools_scm/__pycache__/_entrypoints.cpython-312.pyc,,
setuptools_scm/__pycache__/_get_version_impl.cpython-312.pyc,,
setuptools_scm/__pycache__/_log.cpython-312.pyc,,
setuptools_scm/__pycache__/_modify_version.cpython-312.pyc,,
setuptools_scm/__pycache__/_overrides.cpython-312.pyc,,
setuptools_scm/__pycache__/_run_cmd.cpython-312.pyc,,
setuptools_scm/__pycache__/_types.cpython-312.pyc,,
setuptools_scm/__pycache__/_version_cls.cpython-312.pyc,,
setuptools_scm/__pycache__/discover.cpython-312.pyc,,
setuptools_scm/__pycache__/fallbacks.cpython-312.pyc,,
setuptools_scm/__pycache__/git.cpython-312.pyc,,
setuptools_scm/__pycache__/hg.cpython-312.pyc,,
setuptools_scm/__pycache__/hg_git.cpython-312.pyc,,
setuptools_scm/__pycache__/integration.cpython-312.pyc,,
setuptools_scm/__pycache__/scm_workdir.cpython-312.pyc,,
setuptools_scm/__pycache__/version.cpython-312.pyc,,
setuptools_scm/_cli.py,sha256=c1OtDXCGl7IzCdZ8z8yJg9TEBt1eXjh3mgqr16Qc5dQ,5597
setuptools_scm/_config.py,sha256=Zf9jOxr7BWQ8RN863MPOfzO6x8Os_pwYi7VuA0Bbr4U,4968
setuptools_scm/_entrypoints.py,sha256=GX3Lqs4YFUbQMa0mKCVYpXsfP8kR8nIuYbXRYkPaz7Y,3843
setuptools_scm/_file_finders/__init__.py,sha256=QBZkrT7FLNfclH7taOohnNAPkVtaLJva3cHpX0sozbc,3751
setuptools_scm/_file_finders/__pycache__/__init__.cpython-312.pyc,,
setuptools_scm/_file_finders/__pycache__/git.cpython-312.pyc,,
setuptools_scm/_file_finders/__pycache__/hg.cpython-312.pyc,,
setuptools_scm/_file_finders/__pycache__/pathtools.cpython-312.pyc,,
setuptools_scm/_file_finders/git.py,sha256=vW_SGVGTXNFyC4dHOhNjh3ER2Aqp0QNe1qc0XLUIZEQ,4156
setuptools_scm/_file_finders/hg.py,sha256=1I4LPr_k7lIVMTqSl9_h1_csIEYMfRow2ta5FEo0Rjs,2246
setuptools_scm/_file_finders/pathtools.py,sha256=AgOl5u_WHxCQeiUCwlN8bUE3B4vs5BxSJEK1LJutyus,179
setuptools_scm/_get_version_impl.py,sha256=P72m2imnte-J7IXD3nTjYk7gBUoLk6hrZZv5O5r9akY,5940
setuptools_scm/_integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
setuptools_scm/_integration/__pycache__/__init__.cpython-312.pyc,,
setuptools_scm/_integration/__pycache__/dump_version.cpython-312.pyc,,
setuptools_scm/_integration/__pycache__/pyproject_reading.cpython-312.pyc,,
setuptools_scm/_integration/__pycache__/setuptools.cpython-312.pyc,,
setuptools_scm/_integration/__pycache__/toml.cpython-312.pyc,,
setuptools_scm/_integration/dump_version.py,sha256=2VYFa0Aa1YRcrQQVit-COg7w1QaRjmZFM22LYZWuvEg,2584
setuptools_scm/_integration/pyproject_reading.py,sha256=Wz-_ncjggrC-YfCsclIsSd2BkH0OYLdQhl9Insobpcg,2604
setuptools_scm/_integration/setuptools.py,sha256=DcYqpUUMMu_gD2XxdyY3enPFr12pqV9fZa06PuFqBSU,3468
setuptools_scm/_integration/toml.py,sha256=GYXDZOUC-AfQ_WmOIESP1ARBnc6WKIBQy3oDvsF-bUQ,1467
setuptools_scm/_log.py,sha256=BFsXD-s2fcLV3zZaSQkQfRKPS-MjcI0tsmthJ3a2HqA,2137
setuptools_scm/_modify_version.py,sha256=9VU-juFg2IZjrcyz9kLGRfBq4RyZZElhjPMipqjB3Xc,1738
setuptools_scm/_overrides.py,sha256=2-ld0PSoi8IPVUAS3H2aBWM7yxJneDcyydq9ueQRdsE,1655
setuptools_scm/_run_cmd.py,sha256=6AB6Kv1kg75Yx6-p7NHMrXSWTCPWDAN5id8cSF8XW6s,6094
setuptools_scm/_types.py,sha256=QhY9jqXTH8sSxHXNQg2toQduk60s0vXya_Mdfv5rQAg,708
setuptools_scm/_version_cls.py,sha256=9wEWl4WY_sUvqZhN1PQbVETVq9OAQKu1Y47ZPg9vx-c,2925
setuptools_scm/discover.py,sha256=Kfm8S5I078vw8Cvbs9qpKOg5dr2TqBp1us-W579Dlts,2027
setuptools_scm/fallbacks.py,sha256=x3Xv1p89AqJiBX6oxuoo8Di0yR5ijOFOwKBJGAeWTbY,1448
setuptools_scm/git.py,sha256=-FbDzrVeEYd6jgEEzpWfuaeIfksS2QPktHZINXeSyzA,10526
setuptools_scm/hg.py,sha256=iY294X0ZOqLEv_KXmPWwXXsPDhgx4wsOVoxFkM9WiPc,6207
setuptools_scm/hg_git.py,sha256=hx2rq1kwW9Zs23xK9ZCn509emze22iyXvT3zIZh7JFM,4546
setuptools_scm/integration.py,sha256=0l04N6IhRKW32vD9DPvvJuiZ1HrVCYupmNYDcYXu8lQ,806
setuptools_scm/scm_workdir.py,sha256=oreoRhJfvhhxVGIhDPWH8-dg9umsmZM0sV2oRIzGXc8,327
setuptools_scm/version.py,sha256=TzdIjApX5t-aWBwGZoJLykpGWVVStRxH2Fui0RVVXvU,14215
Empty file.
5 changes: 5 additions & 0 deletions setuptools/_build_vendor/setuptools_scm-8.1.0.dist-info/WHEEL
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: bdist_wheel (0.43.0)
Root-Is-Purelib: true
Tag: py3-none-any

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[distutils.setup_keywords]
use_scm_version = setuptools_scm._integration.setuptools:version_keyword

[setuptools.file_finders]
setuptools_scm = setuptools_scm._file_finders:find_files

[setuptools.finalize_distribution_options]
setuptools_scm = setuptools_scm._integration.setuptools:infer_version

[setuptools_scm.files_command]
.git = setuptools_scm._file_finders.git:git_find_files
.hg = setuptools_scm._file_finders.hg:hg_find_files

[setuptools_scm.files_command_fallback]
.git_archival.txt = setuptools_scm._file_finders.git:git_archive_find_files
.hg_archival.txt = setuptools_scm._file_finders.hg:hg_archive_find_files

[setuptools_scm.local_scheme]
dirty-tag = setuptools_scm.version:get_local_dirty_tag
no-local-version = setuptools_scm.version:get_no_local_node
node-and-date = setuptools_scm.version:get_local_node_and_date
node-and-timestamp = setuptools_scm.version:get_local_node_and_timestamp

[setuptools_scm.parse_scm]
.git = setuptools_scm.git:parse
.hg = setuptools_scm.hg:parse

[setuptools_scm.parse_scm_fallback]
.git_archival.txt = setuptools_scm.git:parse_archival
.hg_archival.txt = setuptools_scm.hg:parse_archival
PKG-INFO = setuptools_scm.fallbacks:parse_pkginfo
pyproject.toml = setuptools_scm.fallbacks:fallback_version
setup.py = setuptools_scm.fallbacks:fallback_version

[setuptools_scm.version_scheme]
calver-by-date = setuptools_scm.version:calver_by_date
guess-next-dev = setuptools_scm.version:guess_next_dev_version
no-guess-dev = setuptools_scm.version:no_guess_dev_version
only-version = setuptools_scm.version:only_version
post-release = setuptools_scm.version:postrelease_version
python-simplified-semver = setuptools_scm.version:simplified_semver_version
release-branch-semver = setuptools_scm.version:release_branch_semver_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setuptools_scm
3 changes: 3 additions & 0 deletions setuptools/_build_vendor/setuptools_scm/.git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
30 changes: 30 additions & 0 deletions setuptools/_build_vendor/setuptools_scm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
:copyright: 2010-2023 by Ronny Pfannschmidt
:license: MIT
"""

from __future__ import annotations

from ._config import DEFAULT_LOCAL_SCHEME
from ._config import DEFAULT_VERSION_SCHEME
from ._config import Configuration
from ._get_version_impl import _get_version
from ._get_version_impl import get_version
from ._integration.dump_version import dump_version # soft deprecated
from ._version_cls import NonNormalizedVersion
from ._version_cls import Version
from .version import ScmVersion

# Public API
__all__ = [
"DEFAULT_LOCAL_SCHEME",
"DEFAULT_VERSION_SCHEME",
"Configuration",
"NonNormalizedVersion",
"ScmVersion",
"Version",
"_get_version",
"dump_version",
# soft deprecated imports, left for backward compatibility
"get_version",
]
6 changes: 6 additions & 0 deletions setuptools/_build_vendor/setuptools_scm/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from __future__ import annotations

from ._cli import main

if __name__ == "__main__":
raise SystemExit(main())
Loading

0 comments on commit 2faa82c

Please sign in to comment.