Skip to content

Commit 93b1621

Browse files
authored
Merge pull request #75 from DavidCEllis/add-download-instruction
Add install instruction to readme
2 parents 74beaa2 + d7fef24 commit 93b1621

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
`ducktools-classbuilder` is both an alternate implementation of the dataclasses concept
44
along with a toolkit for creating your own customised implementation.
55

6+
Available from PyPI as [ducktools-classbuilder](https://pypi.org/project/ducktools-classbuilder/).
7+
8+
Installation[^1]:
9+
* With [uv](https://docs.astral.sh/uv/)
10+
* `uv add ducktools-classbuilder` to add to an existing project
11+
* `uv add ducktools-classbuilder --script scriptname.py` to add to
12+
[script dependencies](https://packaging.python.org/en/latest/specifications/inline-script-metadata/#inline-script-metadata)
13+
* `uv run --with ducktools-classbuilder python` to try in the Python repl
14+
* With [poetry](https://python-poetry.org)
15+
* `poetry add ducktools-classbuilder` to add to an existing project
16+
617
Create classes using type annotations:
718

819
```python
@@ -327,7 +338,7 @@ There are also some intentionally missing features:
327338
If you want to use `__slots__` in order to save memory you have to declare
328339
them when the class is originally created as you can't add them later.
329340

330-
When you use `@dataclass(slots=True)`[^1] with `dataclasses`, the function
341+
When you use `@dataclass(slots=True)`[^2] with `dataclasses`, the function
331342
has to make a new class and attempt to copy over everything from the original.
332343

333344
This is because decorators operate on classes *after they have been created*
@@ -470,4 +481,7 @@ with a specific feature, you can create or add it yourself.
470481

471482
Heavily inspired by [David Beazley's Cluegen](https://github.com/dabeaz/cluegen)
472483

473-
[^1]: or `@attrs.define`.
484+
[^1]: I'd like to discourage people from directly using `pip install ducktools-classbuilder`.
485+
I feel like it encourages the bad practice of installing packages into the main runtime folder instead of a virtualenv.
486+
487+
[^2]: or `@attrs.define`.

0 commit comments

Comments
 (0)