Skip to content

Commit 36e17d0

Browse files
authored
Merge pull request #72 from DavidCEllis/update-readme
Document python 3.10 requirement, don't give pip instruction.
2 parents 6a2056f + a69ad56 commit 36e17d0

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

README.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,30 @@
33
Find local python installs on Windows/Linux/MacOS and find the latest installers from python.org
44
for Windows and MacOS or sources for Linux (as python.org does not provide linux installers).
55

6-
Requires Python >= 3.8 (but will discover older Python installs)
6+
Requires Python >= 3.10 (but will discover older Python installs)
77

88
[Download the zipapp here](https://github.com/DavidCEllis/ducktools-pythonfinder/releases/latest/download/pythonfinder.pyz)
99

10-
It is also available as a library on PyPI that can be installed with pip:
11-
`python -m pip install ducktools-pythonfinder`
10+
It is also available as an application and library on PyPI. The simplest way to install this
11+
is with [uv](https://docs.astral.sh/uv/).
12+
13+
With uv:
14+
* Install it as an application with `uv tool install ducktools-pythonfinder`
15+
* Run once with `uvx ducktools-pythonfinder`
16+
* Add it as a library to a project with `uv add ducktools-pythonfinder`
17+
* Add it as a library for a script with `uv add --script scriptname.py ducktools-pythonfinder`
18+
* test it in a repl with `uv run --isolated --with ducktools-pythonfinder python`
19+
20+
If you do not wish to use `uv`, you can also install as an application with
21+
[pipx](https://pipx.pypa.io/latest/), or manually manage dependencies in `pyproject.toml`,
22+
[inline script metadata](https://packaging.python.org/en/latest/specifications/inline-script-metadata/#inline-script-metadata)
23+
or in virtual environments using `pip`.
1224

1325
## Command Line Usage ##
1426

1527
`ducktools-pythonfinder` can be used as a module or as a bundled zipapp (as `pythonfinder.pyz`).
1628

17-
`python pythonfinder.pyz` or `python -m ducktools.pythonfinder`
29+
`python pythonfinder.pyz` or `python -m ducktools.pythonfinder`
1830
will provide a table of installed python versions
1931
and their respective folders. It will also indicate the python running the
2032
command if it is found, or the python that is the base for the venv running the command.
@@ -23,18 +35,18 @@ Python versions listed can be restricted by using the `--max`, `--min` and
2335
`--compatible` options to the command. These roughly translate to `>=` for min, `<` for max
2436
and `~=` for compatible in python version specifiers.
2537

26-
If you wish to find the latest binaries available from python.org for your platform
38+
If you wish to find the latest binaries available from python.org for your platform
2739
(or sources on Linux) there is the additional `online` command with some extra flags.
2840

29-
By default it will fetch the latest patches for each Python release (eg: 2.7.18 for 2.7) for
41+
By default it will fetch the latest patches for each Python release (eg: 2.7.18 for 2.7) for
3042
the hardware you're on. The filters for local versions also work.
3143

3244
* `--all-binaries` will get you all binary releases that match the restrictions.
3345
* `--system` and `--machine` allow you to specify a platform other than the one you are using
3446
(the values you give should match platform.system() and platform.machine() return values).
3547
* `--prerelease` includes prerelease versions in the search.
3648

37-
Example:
49+
Example:
3850
`python pythonfinder.pyz online --min 3.10 --system Windows --machine AMD64`
3951

4052
```
@@ -61,8 +73,8 @@ On Windows these methods will search the registry for PEP514 recorded python ins
6173
before checking for any `pyenv-win` installs that have not been registered. Finally, if
6274
`uv` is available it will try to find Python installs managed by `uv`.
6375

64-
On Linux and MacOS this will search for `pyenv` installs first,
65-
if `uv` is available it will then try to find `uv` managed python installs.
76+
On Linux and MacOS this will search for `pyenv` installs first,
77+
if `uv` is available it will then try to find `uv` managed python installs.
6678
Finally it will search `PATH` for any other `python*` binaries that might be available.
6779

6880
If a python install is found twice (for instance a pyenv install in the windows registry)
@@ -131,8 +143,8 @@ latest_prerelease_binary = searcher.latest_binary_match(SpecifierSet(">=3.10"),
131143
## Why? ##
132144

133145
For the purposes of PEP723 script dependencies and other releated tools
134-
it may be useful to find another version of python other than the one currently running
135-
in order to satisfy the `requires-python` field.
146+
it may be useful to find another version of python other than the one currently running
147+
in order to satisfy the `requires-python` field.
136148
This tool is intended to search for potential python installs to attempt to
137149
satisfy such a requirement.
138150

0 commit comments

Comments
 (0)