Skip to content

Commit

Permalink
Update cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Dec 9, 2024
1 parent bb294df commit a6f6dc4
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/cthoyt/cookiecutter-snekpack",
"commit": "12edfcfa5f519467b5d834f0d4e706fb7cf4f065",
"commit": "f217081a86752e77b638d76e92a1f536a4906733",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository
github:
- cthoyt
7 changes: 4 additions & 3 deletions .github/workflows/cruft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

name: Update repository with Cruft

permissions:
contents: write
pull-requests: write
permissions: {}

on:
workflow_dispatch:
Expand All @@ -13,6 +11,9 @@ on:

jobs:
update:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
strategy:
fail-fast: true
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

name: Tests

# by default, give the GITHUB_TOKEN no permissions
# See https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
permissions: {}

on:
push:
branches: [ main ]
Expand All @@ -13,6 +17,11 @@ on:
jobs:
lint:
name: Code Quality
permissions:
# give only read-only access to the contents of the repository
# this is the only permission this job requires, so keep it to the least privilege
# i.e., not to issues, discussions, actions, etc.
contents: read
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -31,6 +40,8 @@ jobs:
docs:
name: Documentation
permissions:
contents: read
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -56,6 +67,8 @@ jobs:
run: uvx -p ${{ matrix.python-version }} --with tox-uv tox -e docs-test
tests:
name: Tests
permissions:
contents: read
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ classifiers = [
"Framework :: Pytest",
"Framework :: tox",
"Framework :: Sphinx",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Typing :: Typed",
]
keywords = [
"snekpack", # please keep this keyword to credit the cookiecutter-snekpack template
Expand Down Expand Up @@ -87,6 +90,12 @@ Documentation = "https://pystow.readthedocs.io"

[tool.setuptools]
package-dir = { "" = "src" }
# This fix is here as a final tombstone before getting rid of setuptools and
# replacing with uv's build backend. It appears that the setuptools team hasn't
# prioritized fixing the fully breaking bug in metadata emission described in
# https://github.com/pypa/setuptools/issues/4759. Luckily, the license
# is inferred from the trove classifier for MIT license.
license-files = []

[tool.setuptools.packages.find]
# this implicitly sets `packages = ":find"`
Expand All @@ -96,11 +105,9 @@ where = ["src"] # list of folders that contain the packages (["."] by default)
[tool.setuptools.package-data]
"*" = ["*.*"]


[project.scripts]
pystow = "pystow.cli:main"


[tool.cruft]
skip = [
"**/__init__.py",
Expand Down
15 changes: 14 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ commands =
# 7. Add your token to keyring with `keyring set https://upload.pypi.org/legacy/ __token__`

[testenv:release]
description = Release the code to PyPI so users can pip install it
description = Release the code to PyPI so users can pip install it, using credentials from keyring
skip_install = true
deps =
{[testenv:build]deps}
Expand All @@ -234,6 +234,19 @@ commands =
{[testenv:build]commands}
uv publish --username __token__ --keyring-provider subprocess --publish-url https://upload.pypi.org/legacy/

[testenv:release-via-env]
description = Release the code to PyPI so users can pip install it, using credentials from the environment.
skip_install = true
deps =
{[testenv:build]deps}
uv
commands =
{[testenv:build]commands}
uv publish --publish-url https://upload.pypi.org/legacy/
passenv =
UV_PUBLISH_USERNAME
UV_PUBLISH_PASSWORD

[testenv:finish]
description =
Run a workflow that removes -dev from the version, creates a tagged release on GitHub,
Expand Down

0 comments on commit a6f6dc4

Please sign in to comment.