Skip to main content

python/README.md

1# python
3These scripts are all for working with Python.
5## The individual scripts
7<!-- [[[cog
9# This adds the root of the repo to the PATH, which has cog_helpers.py
10from os.path import abspath, dirname
11import sys
13sys.path.append(abspath(dirname(dirname("."))))
15import cog_helpers
17folder_name = "python"
19scripts = [
20 {
21 "usage": "depanalysis",
22 "description": """
23 get a summary of every Python version installed in every Python virtualenv on my computer.
24 """,
25 },
26 {
27 "usage": "deploy_to_pypi",
28 "description": """
29 deploy a new version of a Python library: bump the version, tag the Git commit, push to PyPI and GitHub.
30 """,
31 },
32 {
33 "usage": "get_all_venv_deps",
34 "description": """
35 print all the dependencies installed in every virtualenv on my computer. See https://alexwlchan.net/2026/python-package-audit/
36 """,
37 },
38 {
39 "name": "pyfmt [...PATH]",
40 "description": "Format Python files with ruff.",
41 },
42 {
43 "name": "pip_compile (--upgrade) (--no-cache)",
44 "description": "Compile any `requirements.in` files into a list of exact versions in `requirements.txt`.",
45 },
46 {
47 "name": "run_pip_sync (--no-cache)",
48 "description": "A wrapper around `uv pip sync`. You don't need to call this directly.",
49 },
52cog_helpers.create_description_table(folder_name=folder_name, scripts=scripts)
54]]]-->
55<dl>
56 <dt>
57 <a href="https://github.com/alexwlchan/scripts/blob/main/python/depanalysis">
58 <code>depanalysis</code>
59 </a>
60 </dt>
61 <dd>
62 get a summary of every Python version installed in every Python virtualenv on my computer.
63 </dd>
65 <dt>
66 <a href="https://github.com/alexwlchan/scripts/blob/main/python/deploy_to_pypi">
67 <code>deploy_to_pypi</code>
68 </a>
69 </dt>
70 <dd>
71 deploy a new version of a Python library: bump the version, tag the Git commit, push to PyPI and GitHub.
72 </dd>
74 <dt>
75 <a href="https://github.com/alexwlchan/scripts/blob/main/python/get_all_venv_deps">
76 <code>get_all_venv_deps</code>
77 </a>
78 </dt>
79 <dd>
80 print all the dependencies installed in every virtualenv on my computer. See https://alexwlchan.net/2026/python-package-audit/
81 </dd>
83 <dt>
84 <a href="https://github.com/alexwlchan/scripts/blob/main/python/pyfmt">
85 <code>pyfmt [...PATH]</code>
86 </a>
87 </dt>
88 <dd>
89 Format Python files with ruff.
90 </dd>
92 <dt>
93 <a href="https://github.com/alexwlchan/scripts/blob/main/python/pip_compile">
94 <code>pip_compile (--upgrade) (--no-cache)</code>
95 </a>
96 </dt>
97 <dd>
98 Compile any `requirements.in` files into a list of exact versions in `requirements.txt`.
99 </dd>
101 <dt>
102 <a href="https://github.com/alexwlchan/scripts/blob/main/python/run_pip_sync">
103 <code>run_pip_sync (--no-cache)</code>
104 </a>
105 </dt>
106 <dd>
107 A wrapper around `uv pip sync`. You don't need to call this directly.
108 </dd>
109</dl>
110<!-- [[[end]]] (sum: WIjqpb60M8) -->