Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update requires #955

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ Unwanted files must be excluded via `MANIFEST.in`.
The preferred way to configure [setuptools-scm] is to author
settings in a `tool.setuptools_scm` section of `pyproject.toml`.

This feature requires setuptools 60 or later.
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
```toml title="pyproject.toml"
[build-system]
requires = [
"setuptools>=60",
"setuptools-scm>=8.0"]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"
```

That will be sufficient to require [setuptools-scm] for projects
Expand All @@ -46,6 +45,7 @@ dynamically in the `project` section of `pyproject.toml`:
[project]
# version = "0.0.1" # Remove any existing version parameter.
dynamic = ["version"]

[tool.setuptools_scm]
```

Expand Down
12 changes: 3 additions & 9 deletions docs/customizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ setup(use_scm_version={"version_scheme": myversion_func})
```


``` { .python title="pyproject.toml" file="docs/examples/version_scheme_code/pyproject.toml" }
``` { .toml title="pyproject.toml" file="docs/examples/version_scheme_code/pyproject.toml" }
[build-system]
requires = [
"setuptools>=64",
"setuptools_scm>=8",
"wheel",
]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "scm-example"
Expand All @@ -49,9 +46,6 @@ dynamic = [
```

- [ ] add a build block that adds example output
- [ ] correct config after [entangled mkdocs bug] is fixed

[entangled mkdocs bug]: https://github.com/entangled/mkdocs-plugin/issues/1



Expand Down
7 changes: 2 additions & 5 deletions docs/examples/version_scheme_code/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# ~/~ begin <<docs/customizing.md#docs/examples/version_scheme_code/pyproject.toml>>[init]
[build-system]
requires = [
"setuptools>=64",
"setuptools_scm>=8",
"wheel",
]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "scm-example"
Expand Down
11 changes: 4 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ Note: `setuptools_scm>=8` intentionally doesn't depend on setuptools to ease non
Please ensure a recent version of setuptools (>=64) is installed.


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

[project]
name = "example"
# Important: Remove any existing version declaration
Expand Down
14 changes: 6 additions & 8 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ settings in the `tool.setuptools_scm` section of `pyproject.toml`.

It's necessary to use a setuptools version released after 2022.

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

[project]
# version = "0.0.1" # Remove any existing version parameter.
Expand All @@ -27,8 +27,7 @@ Tools that still invoke `setup.py` must ensure build requirements are installed

### version files

```toml
# pyproject.toml
```toml title="pyproject.toml"
...
[tool.setuptools_scm]
version_file = "pkg/_version.py"
Expand Down Expand Up @@ -108,8 +107,7 @@ you can retrieve it at runtime from PEP-0566_ metadata using
``importlib.metadata`` from the standard library (added in Python 3.8)
or the `importlib_metadata`_ backport:

```python
# contents of package_name/__init__.py
```python title="package_name/__init__.py"
from importlib.metadata import version, PackageNotFoundError

try:
Expand Down Expand Up @@ -257,7 +255,7 @@ be kept in version control. It's strongly recommended to be put into gitignore.



### File finders hook makes most of MANIFEST.in unnecessary
### File finders hook makes most of `MANIFEST.in` unnecessary

`setuptools_scm` implements a [file_finders] entry point
which returns all files tracked by your SCM.
Expand Down
Loading