Skip to content

Commit 0ad439e

Browse files
committed
Add installation docs for using Test PyPI
1 parent c9c3fe6 commit 0ad439e

File tree

2 files changed

+126
-7
lines changed

2 files changed

+126
-7
lines changed

changes/+test-pypi.docs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add installation docs for using Test PyPI

docs/installation.md

Lines changed: 125 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,132 @@ Mcproto is available on [PyPI][mcproto-pypi] and can be installed like any other
6969

7070
</div>
7171

72+
## Test PyPI (latest main commit builds)
73+
74+
Mcproto publishes a new version to [Test PyPI][mcproto-testpypi] on **every commit to the `main` branch**, using a
75+
version format like `0.6.0.postN.devX`. This is useful if you want the latest development changes but still prefer
76+
installing from a trusted package index (e.g. one that provides [attestations] or reproducible builds), instead of
77+
relying on VCS links.
78+
79+
Although these builds are technically considered "pre-releases", they are _not_ alpha or beta versions like `0.5.0a1`
80+
(which would appear on PyPI too). They're regular post-development builds made continuously for easier testing and
81+
access.
82+
83+
These builds are functionally identical to what you'd get from installing directly from Git (see [next
84+
section](#latest-git-version)), but Test PyPI offers advantages like:
85+
86+
- Index-based installation with hashes and attestations
87+
- Easier CI/CD and lockfile compatibility
88+
- No need for Git to be installed
89+
90+
!!! warning
91+
92+
Mcproto is still in active development, and changes can happen quickly. These builds may contain bugs or unfinished
93+
features. However, they're useful if you want to try out a fix or feature that hasn't yet been released on the main
94+
PyPI index, as it can sometimes take us a while to publish stable releases during this stage.
95+
96+
To install the latest version from Test PyPI:
97+
98+
=== ":simple-python: pip"
99+
100+
```bash
101+
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple --pre mcproto
102+
```
103+
104+
<div class="result" markdown>
105+
106+
[pip] is the main package installer for Python.
107+
108+
---
109+
110+
Tell pip to prefer Test PyPI for new versions while falling back to PyPI for dependencies.
111+
112+
</div>
113+
114+
=== ":simple-poetry: poetry"
115+
116+
```bash
117+
poetry source add --priority=supplemental testpypi https://test.pypi.org/simple
118+
poetry add --source testpypi mcproto
119+
```
120+
121+
<div class="result" markdown>
122+
123+
[Poetry] is an all-in-one solution for Python project management.
124+
125+
---
126+
127+
Add the testpypi index as an additional source and install mcproto using that source.
128+
129+
</div>
130+
131+
=== ":simple-rye: rye"
132+
133+
```bash
134+
# N/A
135+
```
136+
137+
<div class="result" markdown>
138+
139+
[Rye] is an all-in-one solution for Python project management, written in Rust.
140+
141+
---
142+
143+
Rye does not have a clean way to specify per-package source, it is possible to add Test PyPI as a source and use it
144+
globally, however, this would also affect other packages, and even with this approach, Rye handles dependency
145+
resolution pretty poorly (if a packge is being installed from Test PyPI, all of it's dependencies must be from Test
146+
PyPI, or they must be installed manually).
147+
148+
For this reason, we don't recommend using the Test PyPI index with Rye, instead, if you want the latest release,
149+
follow the git installation method.
150+
151+
</div>
152+
153+
=== ":simple-ruff: uv"
154+
155+
```bash
156+
uv add --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mcproto
157+
```
158+
159+
<div class="result" markdown>
160+
161+
[uv] is an ultra fast dependency resolver and package installer, written in Rust.
162+
163+
---
164+
165+
Uv supports custom indexes via matching pip flags.
166+
167+
</div>
168+
169+
=== ":simple-pdm: pdm"
170+
171+
```bash
172+
# N/A
173+
```
174+
175+
<div class="result" markdown>
176+
177+
[PDM] is an all-in-one solution for Python project management.
178+
179+
---
180+
181+
With PDM, you will want to follow their [documentation][pdm-index-docs] for this type of installation, as it
182+
involves editing `pyproject.toml` manually and a deeper understanding of what you're doing is beneficial.
183+
184+
Alternatively, you can just use the git installation instead.
185+
186+
</div>
187+
72188
## Latest (git) version
73189

74-
Alternatively, you may want to install the latest available version, which is what you currently see in the `main` git
75-
branch. Although this method will actually work for any branch with a pretty straightforward change.
190+
Installing directly from Git gives you the exact same version as Test PyPI: the latest commit to `main`, but also allows
191+
you to install from **any branch or commit**. This is useful if you're testing experimental branches or need a very
192+
specific commit not yet published to Test PyPI, or you just don't want to use the Test PyPI index.
76193

77-
This kind of installation should only be done if you wish to test some new unreleased features and it's likely that you
78-
will encounter bugs.
194+
!!! warning
79195

80-
That said, since mcproto is still in development, changes can often be made quickly and it can sometimes take a while
81-
for these changes to carry over to PyPI. So if you really want to try out that latest feature, this is the method
82-
you'll want.
196+
This type of installation carries the same risks of bugs occuring as the Test PyPI installation. See the warning
197+
notice in that section.
83198

84199
To install the latest mcproto version directly from the `main` git branch, use:
85200

@@ -144,8 +259,11 @@ To install the latest mcproto version directly from the `main` git branch, use:
144259
</div>
145260

146261
[mcproto-pypi]: https://pypi.org/project/mcproto
262+
[mcproto-testpypi]: https://test.pypi.org/project/mcproto/
147263
[pip]: https://pip.pypa.io/en/stable/
148264
[Poetry]: https://python-poetry.org/
149265
[Rye]: https://rye.astral.sh/
150266
[uv]: https://github.com/astral-sh/uv
151267
[PDM]: https://pdm-project.org/en/latest/
268+
[pdm-index-docs]: https://pdm-project.org/latest/usage/config/#specify-index-for-individual-packages
269+
[attestations]: https://docs.pypi.org/attestations/

0 commit comments

Comments
 (0)