Skip to content

Commit 78b004f

Browse files
authored
Merge pull request #31 from 56kyle/develop
Update Usage Info and Add Maturin Fix
2 parents a501278 + 493cb35 commit 78b004f

File tree

4 files changed

+46
-6
lines changed

4 files changed

+46
-6
lines changed

README.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,48 @@
22

33
A Python project template robust enough to follow up [cookiecutter-hypermodern-python]
44

5-
# Example Output
5+
## Usage/Installation
6+
7+
The only prerequisite for using the template is to [install uv].
8+
9+
From there just cd into the directory you want to create the project in and run:
10+
```terminaloutput
11+
uvx cruft create https://github.com/56kyle/cookiecutter-robust-python.git
12+
> [1/15] project_name (robust-python): my-repo-name
13+
> ...
14+
```
15+
16+
#### Local Setup
17+
18+
Once you have generated your project, and preferably before opening the IDE, the normal workflow to setup everything would go as follows:
19+
```terminaloutput
20+
cd my-repo-name
21+
22+
# Sets up a git repo w/ a main/develop branch along with an initial commit of everything just generated.
23+
uvx nox -s setup-git
24+
25+
# Pins the uv python version, generates/syncs a venv, etc.
26+
uvx nox -s setup-venv
27+
28+
# Sets up the remote reference and ensures main/develop are pushed/synced. Requires that the remote exists (should be empty).
29+
uvx nos -s setup-remote
30+
```
31+
32+
You can also run `uvx nox -t env` for the same effect.
33+
34+
35+
## Most Notable Features
36+
- Modern tooling with [uv], [ruff], [cruft], etc.
37+
- Built for supporting most OS's (windows, linux, macos) and all currently supported [python] versions
38+
- Platform agnostic CI/CD ([github], [gitlab], [bitbucket])
39+
- CI/CD that parities local [nox] sessions for all [python]
40+
- [maturin] support that can be at any time during the project's lifecycle
41+
- Designed to be a maintainable template over time through the use of automated demos and integration tests
42+
- ... and much more!
43+
44+
For a general overview of where we are at with this template, please see the [roadmap](#roadmap) section.
45+
46+
## Example Output
647
For an example of this template's output, please visit the [demo](https://github.com/56kyle/robust-python-demo) which is kept up to date with the current state of this template.
748

849
## Roadmap
@@ -137,4 +178,5 @@ of trusted individuals to ensure the project is taken care of.
137178
[ruff]: https://docs.astral.sh/ruff/
138179
[rust]: https://www.rust-lang.org/learn
139180
[rye]: https://rye.astral.sh/
181+
[install uv]: https://docs.astral.sh/uv/getting-started/installation/
140182
[uv]: https://docs.astral.sh/uv/

cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"project_name": "hypermodern-python",
2+
"project_name": "robust-python",
33
"package_name": "{{ cookiecutter.project_name.replace('-', '_') }}",
44
"friendly_name": "{{ cookiecutter.project_name.replace('-', ' ').title() }}",
55
"min_python_version": "3.9",

{{cookiecutter.project_name}}/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def build_python(session: Session) -> None:
205205
"""Build sdist and wheel packages (uv build)."""
206206
session.log(f"Building sdist and wheel packages with py{session.python}.")
207207
{% if cookiecutter.add_rust_extension -%}
208-
session.run("maturin", "develop", "--uv")
208+
session.run("uvx", "maturin", "develop", "--uv")
209209
{% else -%}
210210
session.run("uv", "build", "--sdist", "--wheel", "--out-dir", "dist/", external=True)
211211
{% endif -%}

{{cookiecutter.project_name}}/scripts/setup-remote.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ def get_parser() -> argparse.ArgumentParser:
4949
metavar="PATH",
5050
help="Path to the repo's root directory (must already exist).",
5151
)
52-
parser.add_argument(
53-
"--host", dest="repository_host", help="Repository host (e.g., github.com, gitlab.com)."
54-
)
52+
parser.add_argument("--host", dest="repository_host", help="Repository host (e.g., github.com, gitlab.com).")
5553
parser.add_argument(
5654
"--path", dest="repository_path", help="Repository path (e.g., user/repo, group/subgroup/repo)."
5755
)

0 commit comments

Comments
 (0)