Skip to content

Commit 6a1a6fc

Browse files
committed
📝 docs: move spec parsing to tutorial, enlarge logo
Move the PythonSpec parsing section from how-to to the tutorial where it fits the learning flow better. Scale the SVG logo from 24x24 to 128x128 pixels.
1 parent d27a242 commit 6a1a6fc

3 files changed

Lines changed: 32 additions & 32 deletions

File tree

docs/_static/logo.svg

Lines changed: 1 addition & 1 deletion
Loading

docs/how-to/standalone-usage.rst

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -151,34 +151,3 @@ A :class:`~py_discovery.PythonInfo` object exposes detailed interpreter metadata
151151
info.platform # sys.platform value ("linux", "darwin", "win32").
152152
info.sysconfig_vars # Dict of sysconfig variables.
153153
info.sysconfig_paths # Dict of sysconfig paths.
154-
155-
Parsing specs without discovery
156-
-------------------------------
157-
158-
Use :class:`~py_discovery.PythonSpec` to parse a spec string without running discovery.
159-
160-
.. mermaid::
161-
162-
flowchart TD
163-
Input["cpython3.12t-64-arm64"] --> Parse["PythonSpec.from_string_spec()"]
164-
Parse --> Spec["PythonSpec"]
165-
Spec --> impl["implementation: cpython"]
166-
Spec --> ver["major: 3, minor: 12"]
167-
Spec --> ft["free_threaded: True"]
168-
Spec --> arch["architecture: 64"]
169-
Spec --> mach["machine: arm64"]
170-
171-
style Input fill:#4a90d9,stroke:#2a5f8f,color:#fff
172-
style Spec fill:#4a9f4a,stroke:#2a6f2a,color:#fff
173-
174-
.. code-block:: python
175-
176-
from py_discovery import PythonSpec
177-
178-
spec = PythonSpec.from_string_spec("cpython3.12t-64-arm64")
179-
print(spec.implementation) # cpython
180-
print(spec.major) # 3
181-
print(spec.minor) # 12
182-
print(spec.free_threaded) # True
183-
print(spec.architecture) # 64
184-
print(spec.machine) # arm64

docs/tutorial/getting-started.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,37 @@ Specs follow the pattern ``[impl][version][t][-arch][-machine]``.
9999
- ``>=3.11,<3.13`` -- :pep:`440` version specifier.
100100
- ``cpython>=3.11`` -- :pep:`440` specifier with implementation filter.
101101

102+
Parsing a spec
103+
--------------
104+
105+
Use :class:`~py_discovery.PythonSpec` to parse a spec string into its components without running discovery.
106+
107+
.. mermaid::
108+
109+
flowchart TD
110+
Input["cpython3.12t-64-arm64"] --> Parse["PythonSpec.from_string_spec()"]
111+
Parse --> Spec["PythonSpec"]
112+
Spec --> impl["implementation: cpython"]
113+
Spec --> ver["major: 3, minor: 12"]
114+
Spec --> ft["free_threaded: True"]
115+
Spec --> arch["architecture: 64"]
116+
Spec --> mach["machine: arm64"]
117+
118+
style Input fill:#4a90d9,stroke:#2a5f8f,color:#fff
119+
style Spec fill:#4a9f4a,stroke:#2a6f2a,color:#fff
120+
121+
.. code-block:: python
122+
123+
from py_discovery import PythonSpec
124+
125+
spec = PythonSpec.from_string_spec("cpython3.12t-64-arm64")
126+
print(spec.implementation) # cpython
127+
print(spec.major) # 3
128+
print(spec.minor) # 12
129+
print(spec.free_threaded) # True
130+
print(spec.architecture) # 64
131+
print(spec.machine) # arm64
132+
102133
Without caching
103134
---------------
104135

0 commit comments

Comments
 (0)