Skip to content

Commit c726fce

Browse files
committed
📝 Update package versioning
1 parent 2d32b1c commit c726fce

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

docs/packs/distribution.rst

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,19 @@ as:
171171
[tool.setuptools.dynamic]
172172
version = {attr = "dataprep.VERSION"}
173173
174+
If you would like to make this version available in your package, you can
175+
use the following code:
176+
177+
.. code-block:: python
178+
:caption: src/dataprep/__init__.py
179+
180+
import importlib.metadata
181+
182+
try:
183+
__version__ = importlib.metadata.version(__name__)
184+
except importlib.metadata.PackageNotFoundError:
185+
__version__ = "0.1.dev0" # Fallback for development mode
186+
174187
.. tip::
175188
If the version is in several text files, the use of `Bump My Version
176189
<https://github.com/callowayproject/bump-my-version>`_ may be
@@ -282,17 +295,17 @@ Dependency groups
282295

283296
.. literalinclude:: dataprep/pyproject.toml
284297
:language: toml
285-
:lines: 24-34
286-
:lineno-start: 34
298+
:lines: 26-36
299+
:lineno-start: 26
287300

288301
Recursive dependency groups are also possible. For example, for ``dev`` you can
289302
take over all dependencies from ``docs`` and ``test`` in addition to
290303
``pre-commit``:
291304

292305
.. literalinclude:: dataprep/pyproject.toml
293306
:language: toml
294-
:lines: 35-39
295-
:lineno-start: 35
307+
:lines: 37-41
308+
:lineno-start: 37
296309

297310
You can install these dependency groups, for example with:
298311

0 commit comments

Comments
 (0)