We are following the guide from Python Packages by Tomas Beuzen and Tiffany Timbers for the structure of this template repo. This readme documents differences from their guide and elements that need to be changed in the repo once you use this template for your own named package.
These files/folders need to be edited to use your package name instead of the pypackage_template name. The pyproject.toml will also need author editing.
tests/test_template_package.pysrc/pypackage_templatesrc/pypackage_template/__init__.pymain/pyproject.tomlmkdocs.ymldocs/API.md
We will use uv instead of conda.
- Follow uv's installation scripts
- Now run
uv python install --default.
- You can see your available Python versions with
uv python list. - If you want a specific version of Python, you can run
uv python install 3.12,for example. - You can upgrade to the latest supported patch release for each version with
uv python upgrade.
- mkdocs-material with
uv pip install mkdocs-material --system - Guide on mkdocs-material and his companion website for this video
- However, we are using
uvand will useuv run mkdocs new .instead ofmkdocs new .
The --editable allows us to create an installation that points back to your project directory instead of copying the code into site-packages. With this, we can now edit the source files, and the installed package in the environment is automatically updated.
uv sync --editableWith this run you can now run the following command to evaluate the package within the package specific Python that has the package installed
uv run pythonBecause of the WATCH: options in the mkdocs.yml we can now make edits to our function details and see the edits in real time with
uv run mkdocs serveAfter you have the docs as you want you will need to build them to the docs folder for Github.
uv run mkdocs builduv pip install "git+https://github.com/byuirpytooling/simplefunctsp.git@main"pypackage_template
├── .readthedocs.yml ┐
├── CHANGELOG.md │
├── CONDUCT.md │
├── CONTRIBUTING.md │
├── docs │
│ ├── changelog.md │
│ ├── conduct.md │
│ ├── conf.py │
│ ├── contributing.md │ Package documentation
│ ├── example.ipynb │
│ ├── index.md │
│ ├── make.bat │
│ ├── Makefile │
│ └── requirements.txt │
├── LICENSE │
├── README.md ┘
├── pyproject.toml ┐
├── src │
│ └── pypackage_template │ Package source code, metadata,
│ ├── __init__.py │ and build instructions
│ └── pycounts.py ┘
└── tests ┐
└── test_pycounts.py ┘ Package tests