Skip to content

Commit cd1bd08

Browse files
authored
Merge pull request #3 from JerilynFranz/1.0.1-release
1.0.1 release
2 parents 33cc6d6 + ea520c9 commit cd1bd08

7 files changed

Lines changed: 125 additions & 85 deletions

File tree

.env

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22
Changelog for autopypath
33
========================
44

5+
1.0.1 (2026-01-23)
6+
------------------
7+
8+
- Updated index.rst and README.rst for clarity and consistency.
9+
- Removed an unused `.env` file (no functional changes).
10+
- Removed editor- and workspace-specific files from the source distribution.
11+
- Clarified the purpose of `uv.lock` for reproducible builds.
12+
513
1.0.0 (2026-01-22)
614
------------------
15+
716
- Official release of autopypath version 1.0.0.
817
- Finalized documentation and public API.
918
- Added detailed examples and usage instructions.
@@ -14,10 +23,12 @@ Changelog for autopypath
1423

1524
0.9.1 (2026-01-21)
1625
------------------------
26+
1727
- Added pre-commit Git hooks for code quality checks and formatting on commit.
1828
- Updated index.rst and README.rst documentation.
1929
- Bumped version to 0.9.1.
2030

2131
0.9.0 (2026-01-21)
2232
------------------------
33+
2334
- Initial release for version 0.9.0 to PyPI

README.rst

Lines changed: 56 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,43 @@ autopypath
3131
:target: https://github.com/astral-sh/ruff
3232
:alt: Ruff
3333

34+
Table of Contents
35+
-----------------
36+
- `Usage <https://python-autopypath.readthedocs.io/en/latest/usage.html>`_
37+
- `Configuration <https://python-autopypath.readthedocs.io/en/latest/configuration.html>`_
38+
- `Public API <https://python-autopypath.readthedocs.io/en/latest/public_api.html>`_
39+
- `Contributing <https://python-autopypath.readthedocs.io/en/latest/contributing.html>`_
40+
- `Code of Conduct <https://python-autopypath.readthedocs.io/en/latest/code_of_conduct.html>`_
41+
3442
What is autopypath?
3543
-------------------
3644

3745
**autopypath** is a library that simplifies the management of the Python module
38-
search path (`sys.path`) for testing and development environments.
46+
search path (``sys.path``) for testing and development environments.
3947

40-
It automatically detects your project root (via `.git`, `pyproject.toml`, etc.)
41-
and intelligently adds source directories to `sys.path` at runtime.
48+
It automatically detects your project root (via `.git <https://git-scm.com/>`_,
49+
`pyproject.toml <https://python-poetry.org/docs/pyproject/>`_, etc.)
50+
and intelligently adds source directories to ``sys.path`` at runtime.
51+
52+
It *does not* read ``.env`` files to derive
53+
`PYTHONPATH <https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPATH>`_ because
54+
the semantics cannot be consistently interpreted across different operating systems.
55+
56+
For example, consider ``PYTHONPATH=src:test;lib``:
57+
58+
* On POSIX, ``PYTHONPATH`` is separated by ``:`` → ``["src", "test;lib"]``
59+
* On Windows, ``PYTHONPATH`` is separated by ``;`` → ``["src:test", "lib"]``
60+
* And the intent may have been ``["src", "test", "lib"]``
61+
62+
All of those interpretations are "reasonable", so autopypath avoids guessing
63+
what was meant and instead uses ``pyproject.toml`` or ``autopypath.toml`` for configuration.
4264

4365
The Problem it Solves
4466
~~~~~~~~~~~~~~~~~~~~~
4567

4668
In active development, **builds are often broken.**
47-
Standard test runners (like `pytest` or `tox`) often refuse to start if they
69+
Standard test runners (like `pytest <https://docs.pytest.org/en/stable/>`_ or
70+
`tox <https://tox.wiki/>`_) often refuse to start if they
4871
cannot import the entire package, or if the package hasn't been re-installed
4972
into the virtual environment after a structural change.
5073

@@ -55,19 +78,10 @@ into the virtual environment after a structural change.
5578
- Other parts of the test suite are failing due to ongoing refactoring.
5679

5780
It is not a replacement for `virtual environments <https://docs.python.org/3/library/venv.html>`_,
58-
but a resilience tool. It dynamically fixes "Module Not Found" errors on load, allowing you to
59-
debug a specific file without needing the entire project ecosystem to be in a perfect,
81+
but a resilience tool. It mitigates path-related ``ModuleNotFoundError`` errors,
82+
allowing you to debug a specific file without needing the entire project ecosystem to be in a perfect,
6083
deployable state.
6184

62-
Documentation
63-
-------------
64-
65-
- `Usage <https://python-autopypath.readthedocs.io/en/latest/usage.html>`_
66-
- `Configuration <https://python-autopypath.readthedocs.io/en/latest/configuration.html>`_
67-
- `Public API <https://python-autopypath.readthedocs.io/en/latest/public_api.html>`_
68-
- `Contributing <https://python-autopypath.readthedocs.io/en/latest/contributing.html>`_
69-
- `Code of Conduct <https://python-autopypath.readthedocs.io/en/latest/code_of_conduct.html>`_
70-
7185
Installation
7286
------------
7387

@@ -90,44 +104,47 @@ Installing from Source
90104
Development Installation
91105
~~~~~~~~~~~~~~~~~~~~~~~~
92106

93-
For development purposes, you can install `autopypath` in editable mode. To make this easier, a `bootstrap.py` script is provided.
107+
For development purposes, you can install ``autopypath`` in editable mode.
108+
To make this easier, a ``bootstrap.py`` script is provided.
94109

95110
.. code-block:: shell
96111
97112
git clone https://github.com/JerilynFranz/python-autopypath.git
98113
cd python-autopypath
99114
python3 bootstrap.py
100-
source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
115+
source .venv/bin/activate # On Windows use .venv\Scripts\activate
101116
102117
This script will:
103-
1. Set up the development environment (`uv` sync).
104-
2. Install `autopypath` in editable mode.
118+
119+
1. Set up the development environment (``uv sync --all-groups``).
120+
2. Install ``autopypath`` in editable mode.
105121
3. Install Git hooks for pre-commit checks.
106-
4. Install development tools like `tox`, `sphinx`, and `ruff`.
122+
4. Install development tools like `tox <https://tox.wiki/>`_, `sphinx <https://www.sphinx-doc.org/en/master/>`_, and `ruff <https://ruff.rs/>`_.
107123

108124
Usage
109125
-----
110126

111-
Simply import `autopypath` at the top of your test script. It will
112-
automatically detect the project root and adjust `sys.path` accordingly
113-
(by default adding `src`, `lib`, `src/tests`, and `tests` directories if they exist).
127+
Simply import ``autopypath`` at the top of your test script. It will
128+
automatically detect the project root and adjust ``sys.path`` accordingly
129+
(by default adding ``src``, ``lib``, ``src/tests``, and ``tests`` directories if they exist).
114130

115-
It does not add '.' to `sys.path` by default to avoid conflicts with subdirectories
131+
It does not add ``.`` to ``sys.path`` by default to avoid conflicts with subdirectories
116132
that are NOT intended to be packages, but if you want to include the repo root
117-
directory, you can configure it via `pyproject.toml` or `autopypath.toml`.
133+
directory, you can configure it
134+
via `pyproject.toml <https://python-poetry.org/docs/pyproject/>`_ or ``autopypath.toml``.
118135

119-
Here is an example `tests/my_test_script.py`:
136+
Here is an example:
120137

121138
.. code-block:: python
122139
123-
import autopypath # <--- This line magics the sys.path
140+
import autopypath # <--- This line adjusts the sys.path
124141
import pytest
125142
126143
# Now these imports work without installing the package
127144
import mypackage.my_module
128145
129146
if __name__ == '__main__':
130-
pytest.main([__file__])
147+
pytest.main([__file__])
131148
132149
You can now run this file directly:
133150

@@ -138,33 +155,29 @@ You can now run this file directly:
138155
Configuration
139156
-------------
140157

141-
autopypath automatically detects `pyproject.toml`. You can configure it
142-
by adding a ``[tool.autopypath]`` section.
158+
autopypath automatically detects `pyproject.toml <https://python-poetry.org/docs/pyproject/>`_.
159+
You can configure it by adding a ``[tool.autopypath]`` section.
143160

144161
**Example `pyproject.toml`:**
145162

146163
.. code-block:: toml
147164
148-
[tool.autopypath]
149-
paths = ["lib", "src/tests", ".", "src"]
165+
[tool.autopypath]
166+
paths = ["lib", "src/tests", ".", "src"]
150167
151-
If you do not use `pyproject.toml`, you can create an `autopypath.toml` file
152-
either in your root directory or in subdirectories such as `src` or `tests`
168+
If you do not use ``pyproject.toml``, you can create an ``autopypath.toml`` file
169+
either in your root directory or in subdirectories such as ``src`` or ``tests``
153170
and it will be detected automatically. This can be useful for monorepos or
154-
multi-package repositories and allows customization of `sys.path` per sub-project
171+
multi-package repositories and allows customization of ``sys.path`` per sub-project
155172
or for detection of the project root in non-standard layouts.
156173

157174
**Example `autopypath.toml`:**
158175

159176
.. code-block:: toml
160177
161-
[tool.autopypath]
162-
paths = ["src", "src/lib", "tests"]
163-
repo_markers = {".git" = "dir"}
164-
178+
[tool.autopypath]
179+
paths = ["src", "src/lib", "tests"]
180+
repo_markers = {".git" = "dir"}
181+
165182
This file can be placed in the root of your project or in any directory
166183
that is a parent of your test scripts (but still inside the repo).
167-
168-
You can use it to customize which directories are added to `sys.path`, or to
169-
specify custom repository markers for detecting the project root as well
170-
as other settings affecting path resolution behavior.

docs_source/contributing.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ To contribute code or documentation updates to `autopypath`, follow these steps:
135135

136136
10. Engage in the code review process and make any necessary changes based on feedback.
137137

138+
139+
uv.lock
140+
-------
141+
142+
uv.lock is included in the source distribution to support reproducible
143+
builds and independent verification. Use of uv is optional for contributors.
144+
138145
Need Help?
139146
----------
140147

docs_source/index.rst

Lines changed: 47 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,29 @@ What is autopypath?
5252
**autopypath** is a library that simplifies the management of the Python module
5353
search path (:data:`sys.path`) for testing and development environments.
5454

55-
It automatically detects your project root (via `.git`, `pyproject.toml`, etc.)
55+
It automatically detects your project root (via `.git <https://git-scm.com/>`_,
56+
`pyproject.toml <https://python-poetry.org/docs/pyproject/>`_, etc.)
5657
and intelligently adds source directories to :data:`sys.path` at runtime.
5758

59+
It *does not* read ``.env`` files to derive
60+
`PYTHONPATH <https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPATH>`_ because
61+
the semantics cannot be consistently interpreted across different operating systems.
62+
63+
For example, consider ``PYTHONPATH=src:test;lib``:
64+
65+
* On POSIX, ``PYTHONPATH`` is separated by ``:`` → ``["src", "test;lib"]``
66+
* On Windows, ``PYTHONPATH`` is separated by ``;`` → ``["src:test", "lib"]``
67+
* And the intent may have been ``["src", "test", "lib"]``
68+
69+
All of those interpretations are "reasonable", so autopypath avoids guessing
70+
what was meant and instead uses ``pyproject.toml`` or ``autopypath.toml`` for configuration.
71+
5872
The Problem it Solves
5973
~~~~~~~~~~~~~~~~~~~~~
6074

6175
In active development, **builds are often broken.**
62-
Standard test runners (like `pytest` or `tox`) often refuse to start if they
76+
Standard test runners (like `pytest <https://docs.pytest.org/en/stable/>`_ or
77+
`tox <https://tox.wiki/>`_) often refuse to start if they
6378
cannot import the entire package, or if the package hasn't been re-installed
6479
into the virtual environment after a structural change.
6580

@@ -70,18 +85,10 @@ into the virtual environment after a structural change.
7085
- Other parts of the test suite are failing due to ongoing refactoring.
7186

7287
It is not a replacement for `virtual environments <https://docs.python.org/3/library/venv.html>`_,
73-
but a resilience tool. It dynamically fixes "Module Not Found" errors on load, allowing you to
74-
debug a specific file without needing the entire project ecosystem to be in a perfect,
88+
but a resilience tool. It mitigates path-related :class:`ModuleNotFoundError` errors,
89+
allowing you to debug a specific file without needing the entire project ecosystem to be in a perfect,
7590
deployable state.
7691

77-
Documentation
78-
-------------
79-
80-
- `Usage <https://python-autopypath.readthedocs.io/en/latest/usage.html>`_
81-
- `Configuration <https://python-autopypath.readthedocs.io/en/latest/configuration.html>`_
82-
- `Contributing <https://python-autopypath.readthedocs.io/en/latest/contributing.html>`_
83-
- `Code of Conduct <https://python-autopypath.readthedocs.io/en/latest/code_of_conduct.html>`_
84-
8592
Installation
8693
------------
8794

@@ -104,45 +111,48 @@ Installing from Source
104111
Development Installation
105112
~~~~~~~~~~~~~~~~~~~~~~~~
106113

107-
For development purposes, you can install `autopypath` in editable mode.
108-
To make this easier, a `bootstrap.py` script is provided.
114+
For development purposes, you can install ``autopypath`` in editable mode.
115+
To make this easier, a ``bootstrap.py`` script is provided.
109116

110117
.. code-block:: shell
111118
112119
git clone https://github.com/JerilynFranz/python-autopypath.git
113120
cd python-autopypath
114121
python3 bootstrap.py
115-
source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
122+
source .venv/bin/activate # On Windows use .venv\Scripts\activate
116123
117124
This script will:
118-
1. Set up the development environment (`uv` sync).
119-
2. Install `autopypath` in editable mode.
125+
126+
1. Set up the development environment (``uv sync --all-groups``).
127+
2. Install ``autopypath`` in editable mode.
120128
3. Install Git hooks for pre-commit checks.
121-
4. Install development tools like `tox`, `sphinx`, and `ruff`.
129+
4. Install development tools like `tox <https://tox.wiki/>`_, `sphinx <https://www.sphinx-doc.org/en/master/>`_, and `ruff <https://ruff.rs/>`_.
122130

123131
Usage
124132
-----
125133

126-
Simply import `autopypath` at the top of your test script. It will
134+
Simply import ``autopypath`` at the top of your test script. It will
127135
automatically detect the project root and adjust :data:`sys.path` accordingly
128-
(by default adding `src`, `lib`, `src/tests`, and `tests` directories if they exist).
136+
(by default adding ``src``, ``lib``, ``src/tests``, and ``tests`` directories if they exist).
129137

130-
It does not add '.' to :data:`sys.path` by default to avoid conflicts with subdirectories
138+
It does not add ``.`` to :data:`sys.path` by default to avoid conflicts with subdirectories
131139
that are NOT intended to be packages, but if you want to include the repo root
132-
directory, you can configure it via `pyproject.toml` or `autopypath.toml`.
140+
directory, you can configure it
141+
via `pyproject.toml <https://python-poetry.org/docs/pyproject/>`_ or ``autopypath.toml``.
133142

134-
Here is an example `tests/my_test_script.py`:
143+
Here is an example:
135144

136145
.. code-block:: python
146+
:caption: tests/my_test_script.py
137147
138-
import autopypath # <--- This line magics the sys.path
148+
import autopypath # <--- This line adjusts the sys.path
139149
import pytest
140150
141151
# Now these imports work without installing the package
142152
import mypackage.my_module
143153
144154
if __name__ == '__main__':
145-
pytest.main([__file__])
155+
pytest.main([__file__])
146156
147157
You can now run this file directly:
148158

@@ -153,29 +163,31 @@ You can now run this file directly:
153163
Configuration
154164
-------------
155165

156-
autopypath automatically detects `pyproject.toml`. You can configure it by
157-
adding a ``[tool.autopypath]`` section.
166+
autopypath automatically detects `pyproject.toml <https://python-poetry.org/docs/pyproject/>`_.
167+
You can configure it by adding a ``[tool.autopypath]`` section.
158168

159169
**Example `pyproject.toml`:**
160170

161171
.. code-block:: toml
172+
:caption: pyproject.toml
162173
163-
[tool.autopypath]
164-
paths = ["lib", "src/tests", ".", "src"]
174+
[tool.autopypath]
175+
paths = ["lib", "src/tests", ".", "src"]
165176
166-
If you do not use `pyproject.toml`, you can create an `autopypath.toml` file
167-
either in your root directory or in subdirectories such as `src` or `tests`
177+
If you do not use ``pyproject.toml``, you can create an ``autopypath.toml`` file
178+
either in your root directory or in subdirectories such as ``src`` or ``tests``
168179
and it will be detected automatically. This can be useful for monorepos or
169180
multi-package repositories and allows customization of :data:`sys.path` per sub-project
170181
or for detection of the project root in non-standard layouts.
171182

172183
**Example `autopypath.toml`:**
173184

174185
.. code-block:: toml
186+
:caption: autopypath.toml
175187
176-
[tool.autopypath]
177-
paths = ["src", "src/lib", "tests"]
178-
repo_markers = {".git" = "dir"}
179-
188+
[tool.autopypath]
189+
paths = ["src", "src/lib", "tests"]
190+
repo_markers = {".git" = "dir"}
191+
180192
This file can be placed in the root of your project or in any directory
181193
that is a parent of your test scripts (but still inside the repo).

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ exclude = [
243243
exclude = [
244244
".trunk/",
245245
".git/",
246+
".vscode/",
247+
"python-autopypath.code-workspace",
246248
"coverage/",
247249
"coverage_html_report/",
248250
"examples/",

0 commit comments

Comments
 (0)