Skip to content

Commit

Permalink
Revert "feat: make setuptools_scm optional and non-default"
Browse files Browse the repository at this point in the history
This reverts commit b8be71b.
  • Loading branch information
tekumara committed Jul 17, 2024
1 parent 4954d96 commit 2d4c3bf
Show file tree
Hide file tree
Showing 21 changed files with 14 additions and 291 deletions.
9 changes: 4 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# unless otherwise specified, hooks run on push only
default_stages: [push]
repos:
# disabled because {{cookiecutter.repo_name}}/pyproject.toml is jinja not valid toml
# - repo: https://github.com/crate-ci/typos
# rev: v1.23.2
# hooks:
# - id: typos
- repo: https://github.com/crate-ci/typos
rev: v1.23.2
hooks:
- id: typos
# formatters and linters are available in the virtualenv so they can be run from the makefile & vscode
- repo: local
hooks:
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ The template will ask for the following:
- `package_name`: The name of your main python package. A python package is a group of modules, ie: a directory with _\_\_init\_\_.py_ file. Choose a short all-lowercase name without hyphens. The use of underscores is discouraged (see [PEP8](https://www.python.org/dev/peps/pep-0008/#package-and-module-names)).
- [`project_name`](https://www.python.org/dev/peps/pep-0508/#names): The name of the artifact when your project is built as a wheel or source distribution (aka sdist). Project names are lowered kebab-case. In most cases the package name and project name will be the same. This is used in _pyproject.toml_ and needed even if you aren't building a wheel or sdist.
- `description`: a one line description of your project.
- `setuptools_scm`: use setuptools_scm to derive the version from git tags. Versions are calculated from the git repo state as per [Default versioning scheme](https://github.com/pypa/setuptools_scm/blob/main/docs/usage.md#default-versioning-scheme).

## Getting started

Expand Down
3 changes: 1 addition & 2 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"repo_name": "repo-name",
"package_name": "{{ cookiecutter.repo_name|replace('-', '') }}",
"project_name": "{{ cookiecutter.repo_name }}",
"description": "one line description of your project",
"setuptools_scm": ["False", "True"]
"description": "one line description of your project"
}
1 change: 0 additions & 1 deletion snapshots/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ default_context:
package_name: "mypackage"
project_name: "my-project"
description: "example cookie rendered from the template"
setuptools_scm: "False"
8 changes: 6 additions & 2 deletions snapshots/default/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "my-project"
description = "example cookie rendered from the template"
version = "0.0.0"
dynamic = ["version"]
readme = "README.md"
requires-python = ">=3.11"
dependencies = []
Expand All @@ -16,12 +16,16 @@ dev = [
]

[build-system]
requires = ["setuptools~=69.1", "wheel~=0.42"]
requires = ["setuptools~=69.1", "setuptools_scm~=8.0", "wheel~=0.42"]

[tool.setuptools.packages.find]
where = ["."]
exclude = ["tests*", "node_modules*", "build*"]

# enable setuptools_scm to set the version based on git tags
[tool.setuptools_scm]
fallback_version = "0.0.0"

[tool.pyright]
venvPath = "."
venv = ".venv"
Expand Down
6 changes: 0 additions & 6 deletions snapshots/setuptools-scm.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions snapshots/setuptools-scm/.gitignore

This file was deleted.

36 changes: 0 additions & 36 deletions snapshots/setuptools-scm/.pre-commit-config.yaml

This file was deleted.

1 change: 0 additions & 1 deletion snapshots/setuptools-scm/.python-version

This file was deleted.

23 changes: 0 additions & 23 deletions snapshots/setuptools-scm/CONTRIBUTING.md

This file was deleted.

3 changes: 0 additions & 3 deletions snapshots/setuptools-scm/Makefile

This file was deleted.

70 changes: 0 additions & 70 deletions snapshots/setuptools-scm/Makefile-common.mk

This file was deleted.

9 changes: 0 additions & 9 deletions snapshots/setuptools-scm/README.md

This file was deleted.

Empty file.
9 changes: 0 additions & 9 deletions snapshots/setuptools-scm/mypackage/main.py

This file was deleted.

1 change: 0 additions & 1 deletion snapshots/setuptools-scm/mypackage/py.typed

This file was deleted.

5 changes: 0 additions & 5 deletions snapshots/setuptools-scm/package.json

This file was deleted.

87 changes: 0 additions & 87 deletions snapshots/setuptools-scm/pyproject.toml

This file was deleted.

Empty file.
2 changes: 0 additions & 2 deletions snapshots/setuptools-scm/tests/test_example.py

This file was deleted.

13 changes: 3 additions & 10 deletions {{cookiecutter.repo_name}}/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
[project]
name = "{{cookiecutter.project_name}}"
description = "{{cookiecutter.description}}"
{%- if cookiecutter.setuptools_scm == "True" %}
dynamic = ["version"]
{% else %}
version = "0.0.0"
{% endif -%}
readme = "README.md"
requires-python = ">=3.11"
dependencies = []
Expand All @@ -20,19 +16,16 @@ dev = [
]

[build-system]
{%- if cookiecutter.setuptools_scm == "True" %}
requires = ["setuptools~=69.1", "setuptools_scm~=8.0", "wheel~=0.42"]
{% else %}
requires = ["setuptools~=69.1", "wheel~=0.42"]
{% endif %}

[tool.setuptools.packages.find]
where = ["."]
exclude = ["tests*", "node_modules*", "build*"]
{% if cookiecutter.setuptools_scm == "True" %}

# enable setuptools_scm to set the version based on git tags
[tool.setuptools_scm]
fallback_version = "0.0.0"
{% endif %}

[tool.pyright]
venvPath = "."
venv = ".venv"
Expand Down

0 comments on commit 2d4c3bf

Please sign in to comment.