mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-01 04:17:37 +00:00
Use prettier to format the documentation (#5708)
To enforce the 100 character line limit in markdown files introduced in https://github.com/astral-sh/uv/pull/5635, and to automate the formatting of markdown files, i've added prettier and formatted our markdown files with it. I've excluded the changelog and the generated references documentation from this for having too many changes, but we can also include them. I'm not particular on which style we use. My main motivations are (major) not having to reflow markdown files myself anymore and (minor) consistence between all markdown files. I've chosen prettier for similar reason as we chose black, it's a single good style that's automated and shared in the community. I do prefer prettier's style of not breaking inside of a link name though. This PR is in two parts, the first adds prettier to CI and documents using it, while the second actually formats the docs. When merge conflicts arise, we can drop the last commit and regenerate it with `npx prettier --prose-wrap always --write BENCHMARKS.md CONTRIBUTING.md README.md STYLE.md docs/*.md docs/concepts/**/*.md docs/guides/**/*.md docs/pip/**/*.md`. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
parent
f2c4b9c752
commit
db371560bc
42 changed files with 711 additions and 646 deletions
|
|
@ -18,25 +18,27 @@ assert not VersionSpecifier(">=1.1").contains(Version("1.1a1"))
|
|||
assert Version("2.0") in VersionSpecifier("==2")
|
||||
```
|
||||
|
||||
Unlike [pypa/packaging](https://github.com/pypa/packaging), this library always matches preleases. To only match final releases, filter with `.any_prelease()` beforehand.
|
||||
Unlike [pypa/packaging](https://github.com/pypa/packaging), this library always matches preleases.
|
||||
To only match final releases, filter with `.any_prelease()` beforehand.
|
||||
|
||||
PEP 440 has a lot of unintuitive features, including:
|
||||
|
||||
* An epoch that you can prefix the version which, e.g. `1!1.2.3`. Lower epoch always means lower
|
||||
- An epoch that you can prefix the version which, e.g. `1!1.2.3`. Lower epoch always means lower
|
||||
version (`1.0 <=2!0.1`)
|
||||
|
||||
* post versions, which can be attached to both stable releases and pre-releases
|
||||
* dev versions, which can be attached to both table releases and pre-releases. When attached to a
|
||||
pre-release the dev version is ordered just below the normal pre-release, however when attached
|
||||
to a stable version, the dev version is sorted before a pre-releases
|
||||
* pre-release handling is a mess: "Pre-releases of any kind, including developmental releases,
|
||||
are implicitly excluded from all version specifiers, unless they are already present on the
|
||||
system, explicitly requested by the user, or if the only available version that satisfies
|
||||
the version specifier is a pre-release.". This means that we can't say whether a specifier
|
||||
matches without also looking at the environment
|
||||
pre-release the dev version is ordered just below the normal pre-release, however when attached to
|
||||
a stable version, the dev version is sorted before a pre-releases
|
||||
* pre-release handling is a mess: "Pre-releases of any kind, including developmental releases, are
|
||||
implicitly excluded from all version specifiers, unless they are already present on the system,
|
||||
explicitly requested by the user, or if the only available version that satisfies the version
|
||||
specifier is a pre-release.". This means that we can't say whether a specifier matches without
|
||||
also looking at the environment
|
||||
* pre-release vs. pre-release incl. dev is fuzzy
|
||||
* local versions on top of all the others, which are added with a + and have implicitly typed
|
||||
string and number segments
|
||||
* local versions on top of all the others, which are added with a + and have implicitly typed string
|
||||
and number segments
|
||||
* no semver-caret (`^`), but a pseudo-semver tilde (`~=`)
|
||||
* ordering contradicts matching: We have e.g. `1.0+local > 1.0` when sorting,
|
||||
but `==1.0` matches `1.0+local`. While the ordering of versions itself is a total order
|
||||
the version matching needs to catch all sorts of special cases
|
||||
* ordering contradicts matching: We have e.g. `1.0+local > 1.0` when sorting, but `==1.0` matches
|
||||
`1.0+local`. While the ordering of versions itself is a total order the version matching needs to
|
||||
catch all sorts of special cases
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue