cookiecutter-pypackage 0.2.0__tar.gz → 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. cookiecutter_pypackage-0.3.1/.gitignore +210 -0
  2. cookiecutter_pypackage-0.3.1/LICENSE +21 -0
  3. cookiecutter_pypackage-0.3.1/PKG-INFO +114 -0
  4. cookiecutter_pypackage-0.3.1/README.md +78 -0
  5. cookiecutter_pypackage-0.3.1/cookiecutter.json +12 -0
  6. cookiecutter_pypackage-0.3.1/hooks/post_gen_project.py +4 -0
  7. cookiecutter_pypackage-0.3.1/hooks/pre_gen_project.py +14 -0
  8. cookiecutter_pypackage-0.3.1/pyproject.toml +83 -0
  9. cookiecutter_pypackage-0.3.1/src/cookiecutter_pypackage/__init__.py +3 -0
  10. cookiecutter_pypackage-0.3.1/src/cookiecutter_pypackage/cli.py +43 -0
  11. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/.editorconfig +37 -0
  12. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/.github/ISSUE_TEMPLATE.md +15 -0
  13. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/.github/workflows/publish.yml +16 -0
  14. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/.github/workflows/test.yml +39 -0
  15. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/.gitignore +205 -0
  16. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/CODE_OF_CONDUCT.md +89 -0
  17. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/CONTRIBUTING.md +119 -0
  18. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/HISTORY.md +5 -0
  19. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/LICENSE +21 -0
  20. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/MANIFEST.in +10 -0
  21. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/README.md +18 -0
  22. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/docs/index.md +16 -0
  23. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/docs/installation.md +38 -0
  24. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/docs/usage.md +7 -0
  25. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/justfile +86 -0
  26. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/pyproject.toml +58 -0
  27. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/src/{{cookiecutter.project_slug}}/__init__.py +4 -0
  28. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/src/{{cookiecutter.project_slug}}/__main__.py +4 -0
  29. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/src/{{cookiecutter.project_slug}}/cli.py +22 -0
  30. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/src/{{cookiecutter.project_slug}}/utils.py +2 -0
  31. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/src/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}.py +1 -0
  32. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/tests/__init__.py +1 -0
  33. cookiecutter_pypackage-0.3.1/{{cookiecutter.pypi_package_name}}/tests/test_{{cookiecutter.project_slug}}.py +22 -0
  34. cookiecutter_pypackage-0.2.0/LICENSE +0 -27
  35. cookiecutter_pypackage-0.2.0/PKG-INFO +0 -33
  36. cookiecutter_pypackage-0.2.0/README.md +0 -0
  37. cookiecutter_pypackage-0.2.0/README.rst +0 -135
  38. cookiecutter_pypackage-0.2.0/cookiecutter_pypackage.egg-info/PKG-INFO +0 -33
  39. cookiecutter_pypackage-0.2.0/cookiecutter_pypackage.egg-info/SOURCES.txt +0 -12
  40. cookiecutter_pypackage-0.2.0/cookiecutter_pypackage.egg-info/dependency_links.txt +0 -1
  41. cookiecutter_pypackage-0.2.0/cookiecutter_pypackage.egg-info/requires.txt +0 -8
  42. cookiecutter_pypackage-0.2.0/cookiecutter_pypackage.egg-info/top_level.txt +0 -1
  43. cookiecutter_pypackage-0.2.0/hooks/post_gen_project.py +0 -12
  44. cookiecutter_pypackage-0.2.0/hooks/pre_gen_project.py +0 -13
  45. cookiecutter_pypackage-0.2.0/pyproject.toml +0 -50
  46. cookiecutter_pypackage-0.2.0/setup.cfg +0 -4
  47. cookiecutter_pypackage-0.2.0/tests/test_bake_project.py +0 -197
@@ -0,0 +1,210 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Marimo
198
+ marimo/_static/
199
+ marimo/_lsp/
200
+ __marimo__/
201
+
202
+ # Streamlit
203
+ .streamlit/secrets.toml
204
+
205
+
206
+ ######### Added custom Cookiecutter PyPackage generated dirs here
207
+ output/
208
+ python_boilerplate/
209
+ cookiecutter-pypackage-env/
210
+ python-boilerplate/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Audrey M. Roy Greenfeld
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: cookiecutter-pypackage
3
+ Version: 0.3.1
4
+ Summary: Cookiecutter template for a Python package
5
+ Project-URL: homepage, https://github.com/audreyfeldroy/cookiecutter-pypackage
6
+ Author-email: "Audrey M. Roy Greenfeld" <audrey@feldroy.com>
7
+ License: MIT
8
+ License-File: LICENSE
9
+ Keywords: cookiecutter,package,template
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Natural Language :: English
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: Implementation :: CPython
22
+ Classifier: Topic :: Software Development
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: alabaster>=1.0.0
25
+ Requires-Dist: cookiecutter>=2.6.0
26
+ Requires-Dist: typer>=0.16.0
27
+ Requires-Dist: watchdog>=6.0.0
28
+ Provides-Extra: test
29
+ Requires-Dist: coverage; extra == 'test'
30
+ Requires-Dist: ipdb; extra == 'test'
31
+ Requires-Dist: pytest; extra == 'test'
32
+ Requires-Dist: pytest-cookies; extra == 'test'
33
+ Requires-Dist: ruff; extra == 'test'
34
+ Requires-Dist: ty; extra == 'test'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # Cookiecutter PyPackage
38
+
39
+ [![PyPI version](https://img.shields.io/pypi/v/cookiecutter-pypackage.svg)](https://pypi.python.org/pypi/cookiecutter-pypackage)
40
+ [![PyPI downloads](https://img.shields.io/pypi/dm/cookiecutter-pypackage.svg)](https://pypi.python.org/pypi/cookiecutter-pypackage)
41
+
42
+ [Cookiecutter](https://github.com/cookiecutter/cookiecutter) template for a Python package.
43
+
44
+ * GitHub repo: [https://github.com/audreyfeldroy/cookiecutter-pypackage/](https://github.com/audreyfeldroy/cookiecutter-pypackage/)
45
+ * Free software: MIT license
46
+ * Discord: [https://discord.gg/PWXJr3upUE](https://discord.gg/PWXJr3upUE)
47
+
48
+ ## Features
49
+
50
+ * Modern tooling: [uv](https://docs.astral.sh/uv/) for dependency management, [justfile](https://github.com/casey/just) for task running
51
+ * Testing with pytest, GitHub Actions for Python 3.10, 3.11, 3.12, 3.13, and 3.14
52
+ * Auto-release to [PyPI](https://pypi.python.org/pypi) via Trusted Publishers when you push a tag
53
+ * Command line interface using [Typer](https://typer.tiangolo.com/)
54
+
55
+ ## Quickstart
56
+
57
+ First, install [uv](https://docs.astral.sh/uv/getting-started/installation/) if you haven't already.
58
+
59
+ Generate a new Python package:
60
+
61
+ ```bash
62
+ uvx cookiecutter-pypackage
63
+ ```
64
+
65
+ You'll be prompted for some values:
66
+
67
+ ```
68
+ [1/9] full_name (Audrey M. Roy Greenfeld): Your Name
69
+ [2/9] email (audreyfeldroy@example.com): you@example.com
70
+ [3/9] github_username (audreyfeldroy): your-github-username
71
+ [4/9] pypi_package_name (python-boilerplate): my-package
72
+ [5/9] project_name (Python Boilerplate): My Package
73
+ [6/9] project_slug (my_package):
74
+ [7/9] project_short_description (...): A short description of your package.
75
+ [8/9] pypi_username (your-github-username):
76
+ [9/9] first_version (0.1.0):
77
+ ```
78
+
79
+ <details>
80
+ <summary>Traditional way (without uvx)</summary>
81
+
82
+ ```bash
83
+ uv venv
84
+ source .venv/bin/activate
85
+ uv pip install cookiecutter
86
+ cookiecutter gh:audreyfeldroy/cookiecutter-pypackage
87
+ ```
88
+
89
+ </details>
90
+
91
+ Then:
92
+
93
+ * Create a GitHub repo and push your code
94
+ * Set up [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/) for your repo
95
+ * Release your package by pushing a tag: `git tag v0.1.0 && git push --tags`
96
+
97
+ ## Not Exactly What You Want?
98
+
99
+ Don't worry, you have options:
100
+
101
+ ### Fork This / Create Your Own
102
+
103
+ If you have differences in your preferred setup, I encourage you to fork this
104
+ to create your own version. Or create your own; it doesn't strictly have to
105
+ be a fork.
106
+
107
+ ### Similar Cookiecutter Templates
108
+
109
+ Explore other forks to get ideas. See the [network](https://github.com/audreyfeldroy/cookiecutter-pypackage/network) and [family tree](https://github.com/audreyfeldroy/cookiecutter-pypackage/network/members) for this repo.
110
+
111
+ ### Or Submit a Pull Request
112
+
113
+ I also accept pull requests on this, if they're small, atomic, and if they
114
+ make my own packaging experience better.
@@ -0,0 +1,78 @@
1
+ # Cookiecutter PyPackage
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/cookiecutter-pypackage.svg)](https://pypi.python.org/pypi/cookiecutter-pypackage)
4
+ [![PyPI downloads](https://img.shields.io/pypi/dm/cookiecutter-pypackage.svg)](https://pypi.python.org/pypi/cookiecutter-pypackage)
5
+
6
+ [Cookiecutter](https://github.com/cookiecutter/cookiecutter) template for a Python package.
7
+
8
+ * GitHub repo: [https://github.com/audreyfeldroy/cookiecutter-pypackage/](https://github.com/audreyfeldroy/cookiecutter-pypackage/)
9
+ * Free software: MIT license
10
+ * Discord: [https://discord.gg/PWXJr3upUE](https://discord.gg/PWXJr3upUE)
11
+
12
+ ## Features
13
+
14
+ * Modern tooling: [uv](https://docs.astral.sh/uv/) for dependency management, [justfile](https://github.com/casey/just) for task running
15
+ * Testing with pytest, GitHub Actions for Python 3.10, 3.11, 3.12, 3.13, and 3.14
16
+ * Auto-release to [PyPI](https://pypi.python.org/pypi) via Trusted Publishers when you push a tag
17
+ * Command line interface using [Typer](https://typer.tiangolo.com/)
18
+
19
+ ## Quickstart
20
+
21
+ First, install [uv](https://docs.astral.sh/uv/getting-started/installation/) if you haven't already.
22
+
23
+ Generate a new Python package:
24
+
25
+ ```bash
26
+ uvx cookiecutter-pypackage
27
+ ```
28
+
29
+ You'll be prompted for some values:
30
+
31
+ ```
32
+ [1/9] full_name (Audrey M. Roy Greenfeld): Your Name
33
+ [2/9] email (audreyfeldroy@example.com): you@example.com
34
+ [3/9] github_username (audreyfeldroy): your-github-username
35
+ [4/9] pypi_package_name (python-boilerplate): my-package
36
+ [5/9] project_name (Python Boilerplate): My Package
37
+ [6/9] project_slug (my_package):
38
+ [7/9] project_short_description (...): A short description of your package.
39
+ [8/9] pypi_username (your-github-username):
40
+ [9/9] first_version (0.1.0):
41
+ ```
42
+
43
+ <details>
44
+ <summary>Traditional way (without uvx)</summary>
45
+
46
+ ```bash
47
+ uv venv
48
+ source .venv/bin/activate
49
+ uv pip install cookiecutter
50
+ cookiecutter gh:audreyfeldroy/cookiecutter-pypackage
51
+ ```
52
+
53
+ </details>
54
+
55
+ Then:
56
+
57
+ * Create a GitHub repo and push your code
58
+ * Set up [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/) for your repo
59
+ * Release your package by pushing a tag: `git tag v0.1.0 && git push --tags`
60
+
61
+ ## Not Exactly What You Want?
62
+
63
+ Don't worry, you have options:
64
+
65
+ ### Fork This / Create Your Own
66
+
67
+ If you have differences in your preferred setup, I encourage you to fork this
68
+ to create your own version. Or create your own; it doesn't strictly have to
69
+ be a fork.
70
+
71
+ ### Similar Cookiecutter Templates
72
+
73
+ Explore other forks to get ideas. See the [network](https://github.com/audreyfeldroy/cookiecutter-pypackage/network) and [family tree](https://github.com/audreyfeldroy/cookiecutter-pypackage/network/members) for this repo.
74
+
75
+ ### Or Submit a Pull Request
76
+
77
+ I also accept pull requests on this, if they're small, atomic, and if they
78
+ make my own packaging experience better.
@@ -0,0 +1,12 @@
1
+ {
2
+ "full_name": "Audrey M. Roy Greenfeld",
3
+ "email": "audreyfeldroy@example.com",
4
+ "github_username": "audreyfeldroy",
5
+ "pypi_package_name": "python-boilerplate",
6
+ "project_name": "Python Boilerplate",
7
+ "project_slug": "{{ cookiecutter.pypi_package_name.replace('-', '_') }}",
8
+ "project_short_description": "Python Boilerplate contains all the boilerplate you need to create a Python package.",
9
+ "pypi_username": "{{ cookiecutter.github_username }}",
10
+ "first_version": "0.1.0",
11
+ "__gh_slug": "{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}"
12
+ }
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env python
2
+
3
+ if __name__ == "__main__":
4
+ print("Your Python package project has been created successfully!")
@@ -0,0 +1,14 @@
1
+ import re
2
+ import sys
3
+
4
+ MODULE_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]+$"
5
+
6
+ module_name = "{{ cookiecutter.project_slug}}"
7
+
8
+ if not re.match(MODULE_REGEX, module_name):
9
+ print(
10
+ "ERROR: The project slug (%s) is not a valid Python module name. "
11
+ "Please do not use a - and use _ instead" % module_name
12
+ )
13
+ # Exit to cancel project
14
+ sys.exit(1)
@@ -0,0 +1,83 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "cookiecutter-pypackage"
7
+ version = "0.3.1"
8
+ description = "Cookiecutter template for a Python package"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ authors = [
13
+ { name = "Audrey M. Roy Greenfeld", email = "audrey@feldroy.com" }
14
+ ]
15
+ keywords = ["cookiecutter", "template", "package"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Environment :: Console",
19
+ "Intended Audience :: Developers",
20
+ "Natural Language :: English",
21
+ "License :: OSI Approved :: MIT License",
22
+ "Programming Language :: Python",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Programming Language :: Python :: 3.13",
28
+ "Programming Language :: Python :: Implementation :: CPython",
29
+ "Topic :: Software Development",
30
+ ]
31
+ dependencies = [
32
+ "cookiecutter>=2.6.0",
33
+ "typer>=0.16.0",
34
+ "alabaster>=1.0.0",
35
+ "watchdog>=6.0.0",
36
+ ]
37
+
38
+ [project.optional-dependencies]
39
+ test = [
40
+ "coverage", # testing
41
+ "pytest", # testing
42
+ "pytest-cookies", # testing
43
+ "ruff", # linting
44
+ "ty", # checking types
45
+ "ipdb"
46
+ ]
47
+
48
+ [project.scripts]
49
+ cookiecutter-pypackage = "cookiecutter_pypackage.cli:app"
50
+
51
+ [project.urls]
52
+ homepage = "https://github.com/audreyfeldroy/cookiecutter-pypackage"
53
+
54
+ [tool.ruff]
55
+ exclude = [
56
+ "*cookiecutter.pypi_package_name*"
57
+ ]
58
+
59
+ [tool.pytest.ini_options]
60
+ testpaths = [
61
+ "tests",
62
+ ]
63
+
64
+ [dependency-groups]
65
+ dev = [
66
+ "rust-just>=1.42.4",
67
+ ]
68
+
69
+ [tool.hatch.build.targets.sdist]
70
+ include = [
71
+ "src/",
72
+ "cookiecutter.json",
73
+ "hooks/",
74
+ "{{cookiecutter.pypi_package_name}}/",
75
+ ]
76
+
77
+ [tool.hatch.build.targets.wheel]
78
+ packages = ["src/cookiecutter_pypackage"]
79
+
80
+ [tool.hatch.build.targets.wheel.force-include]
81
+ "cookiecutter.json" = "cookiecutter_pypackage/template/cookiecutter.json"
82
+ "hooks" = "cookiecutter_pypackage/template/hooks"
83
+ "{{cookiecutter.pypi_package_name}}" = "cookiecutter_pypackage/template/{{cookiecutter.pypi_package_name}}"
@@ -0,0 +1,3 @@
1
+ """Cookiecutter PyPackage - A modern Python package template."""
2
+
3
+ __version__ = "0.3.1"
@@ -0,0 +1,43 @@
1
+ """CLI for cookiecutter-pypackage.
2
+
3
+ Usage:
4
+ uvx cookiecutter-pypackage
5
+ uvx cookiecutter-pypackage --no-input
6
+ uvx cookiecutter-pypackage -o /path/to/output
7
+ """
8
+
9
+ from pathlib import Path
10
+ from typing import Optional
11
+
12
+ import typer
13
+ from cookiecutter.main import cookiecutter
14
+
15
+ app = typer.Typer(
16
+ help="Generate a Python package from the cookiecutter-pypackage template.",
17
+ add_completion=False,
18
+ )
19
+
20
+
21
+ @app.command()
22
+ def main(
23
+ output_dir: Optional[Path] = typer.Option(
24
+ None, "--output-dir", "-o", help="Where to output the generated project"
25
+ ),
26
+ no_input: bool = typer.Option(
27
+ False, "--no-input", help="Do not prompt for parameters, use defaults"
28
+ ),
29
+ ) -> None:
30
+ """Generate a new Python package from the cookiecutter-pypackage template."""
31
+ # Template is bundled inside the package
32
+ template_dir = Path(__file__).parent / "template"
33
+
34
+ # Run cookiecutter with the bundled template
35
+ cookiecutter(
36
+ str(template_dir),
37
+ output_dir=str(output_dir) if output_dir else ".",
38
+ no_input=no_input,
39
+ )
40
+
41
+
42
+ if __name__ == "__main__":
43
+ app()
@@ -0,0 +1,37 @@
1
+ # https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ end_of_line = lf
7
+ indent_style = space
8
+ indent_size = 4
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [*.{html,css,js,json,sh,yml,yaml}]
13
+ indent_size = 2
14
+
15
+ [*.bat]
16
+ indent_style = tab
17
+ end_of_line = crlf
18
+
19
+ [LICENSE]
20
+ insert_final_newline = false
21
+
22
+ [Makefile]
23
+ indent_style = tab
24
+ indent_size = unset
25
+
26
+ # Ignore binary or generated files
27
+ [*.{png,jpg,gif,ico,woff,woff2,ttf,eot,svg,pdf}]
28
+ charset = unset
29
+ end_of_line = unset
30
+ indent_style = unset
31
+ indent_size = unset
32
+ trim_trailing_whitespace = unset
33
+ insert_final_newline = unset
34
+ max_line_length = unset
35
+
36
+ [*.{diff,patch}]
37
+ trim_trailing_whitespace = false
@@ -0,0 +1,15 @@
1
+ * {{ cookiecutter.project_name }} version:
2
+ * Python version:
3
+ * Operating System:
4
+
5
+ ### Description
6
+
7
+ Describe what you were trying to get done.
8
+ Tell us what happened, what went wrong, and what you expected to happen.
9
+
10
+ ### What I Did
11
+
12
+ ```
13
+ Paste the command(s) you ran and the output.
14
+ If there was a crash, please include the traceback here.
15
+ ```
@@ -0,0 +1,16 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags: ['v*']
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ id-token: write # Required for Trusted Publishers
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: astral-sh/setup-uv@v5
15
+ - run: uv build
16
+ - uses: pypa/gh-action-pypi-publish@release/v1