Skip to content

Commit 62b7e3f

Browse files
Merge pull request #880 from RonnyPfannschmidt/mkdocs
setup more detailed mkdocs documentation
2 parents e62941b + f83d2f3 commit 62b7e3f

24 files changed

+997
-691
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ htmlcov/
4242
.cache
4343
.pytest_cache
4444
.mypy_cache/
45+
.entangled/
46+
4547
nosetests.xml
4648
coverage.xml
4749
*,cover

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ repos:
66
hooks:
77
- id: black
88
args: [--safe, --quiet]
9+
exclude: docs/examples/
910
- repo: https://github.com/asottile/reorder-python-imports
1011
rev: v3.10.0
1112
hooks:
@@ -15,7 +16,6 @@ repos:
1516
rev: v4.4.0
1617
hooks:
1718
- id: trailing-whitespace
18-
- id: end-of-file-fixer
1919
- id: check-yaml
2020
- id: debug-statements
2121
- repo: https://github.com/PyCQA/flake8
@@ -31,6 +31,7 @@ repos:
3131
rev: "1.1.0"
3232
hooks:
3333
- id: pyproject-fmt
34+
exclude: docs/examples/
3435

3536
- repo: https://github.com/pre-commit/mirrors-mypy
3637
rev: 'v1.5.1'

README.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# setuptools_scm
2+
[![github ci](https://github.com/pypa/setuptools_scm/workflows/python%20tests+artifacts+release/badge.svg)](https://github.com/pypa/setuptools_scm/actions)
3+
[![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)
4+
5+
## about
6+
7+
[setuptools-scm] extracts Python package versions from `git` or
8+
`hg` metadata instead of declaring them as the version argument
9+
or in an SCM managed file.
10+
11+
Additionally, [setuptools-scm] provides setuptools
12+
with a list of files that are managed by the SCM <br/>
13+
(i.e. it automatically adds **all of** the SCM-managed files to the sdist).<br/>
14+
Unwanted files must be excluded via `MANIFEST.in`.
15+
16+
17+
## `pyproject.toml` usage
18+
19+
The preferred way to configure [setuptools-scm] is to author
20+
settings in a `tool.setuptools_scm` section of `pyproject.toml`.
21+
22+
This feature requires setuptools 60 or later.
23+
First, ensure that [setuptools-scm] is present during the project's
24+
build step by specifying it as one of the build requirements.
25+
26+
```toml
27+
[build-system]
28+
requires = [
29+
"setuptools>=60",
30+
"setuptools-scm>=8.0"]
31+
```
32+
33+
That will be sufficient to require [setuptools-scm] for projects
34+
that support [PEP 518] like [pip] and [build].
35+
36+
[pip]: https://pypi.org/project/pip
37+
[build]: https://pypi.org/project/build
38+
[PEP 518]: https://peps.python.org/pep-0518/
39+
40+
41+
To enable version inference, you need to set the version
42+
dynamically in the `project` section of `pyproject.toml`:
43+
44+
```toml title="pyproject.toml"
45+
[project]
46+
# version = "0.0.1" # Remove any existing version parameter.
47+
dynamic = ["version"]
48+
[tool.setuptools_scm]
49+
```
50+
51+
Additionally, a version file can be written by specifying:
52+
53+
```toml title="pyproject.toml"
54+
[tool.setuptools_scm]
55+
version_file = "pkg/_version.py"
56+
```
57+
58+
Where `pkg` is the name of your package.
59+
60+
If you need to confirm which version string is being generated or debug the configuration,
61+
you can install [setuptools-scm] directly in your working environment and run:
62+
63+
[setuptools-scm]: https://github.com/pypa/setuptools_scm
64+
65+
```console
66+
$ python -m setuptools_scm
67+
# To explore other options, try:
68+
$ python -m setuptools_scm --help
69+
```
70+
71+
72+
73+
## Interaction with Enterprise Distributions
74+
75+
Some enterprise distributions like RHEL7
76+
ship rather old setuptools versions.
77+
78+
In those cases its typically possible to build by using an sdist against `setuptools_scm<2.0`.
79+
As those old setuptools versions lack sensible types for versions,
80+
modern [setuptools-scm] is unable to support them sensibly.
81+
82+
It's strongly recommended to build a wheel artifact using modern Python and setuptools,
83+
then installing the artifact instead of trying to run against old setuptools versions.
84+
85+
86+
## Code of Conduct
87+
88+
89+
Everyone interacting in the [setuptools-scm] project's codebases, issue
90+
trackers, chat rooms, and mailing lists is expected to follow the
91+
[PSF Code of Conduct].
92+
93+
[PSF Code of Conduct]: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
94+
95+
96+
## Security Contact
97+
98+
To report a security vulnerability, please use the
99+
[Tidelift security contact](https://tidelift.com/security).
100+
Tidelift will coordinate the fix and disclosure.

0 commit comments

Comments
 (0)