Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
- name: Test with tox
run: tox

verify-projects:
name: Verify project
verify-create:
name: Verify app creation
needs: unit-tests
uses: beeware/.github/.github/workflows/app-create-verify.yml@main
with:
Expand All @@ -60,8 +60,8 @@ jobs:
framework: [ "toga", "pyside6", "pygame", "console" ]
runner-os: [ "macos-15", "ubuntu-latest", "windows-latest" ]

verify-apps:
name: Build app
verify-build:
name: Verify app build
needs: unit-tests
uses: beeware/.github/.github/workflows/app-build-verify.yml@main
with:
Expand Down
36 changes: 13 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,22 @@ repos:
- id: check-docstring-first
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/PyCQA/isort
rev: 9.0.0b1
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.7
hooks:
- id: isort
additional_dependencies: [toml]
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
- id: docformatter
args: [--in-place, --black]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.22
hooks:
- id: pyupgrade
args: [--py39-plus]
# Docformatter 1.7.5 isn't compatible with Pre-commit 4.0
# - repo: https://github.com/PyCQA/docformatter
# rev: v1.7.5
# hooks:
# - id: docformatter
# args: [--in-place, --black]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.5.1
- id: ruff-format
- id: ruff-check
args: [ --fix ]
- repo: https://github.com/rvben/rumdl-pre-commit
rev: v0.2.37
hooks:
- id: black
language_version: python3
- repo: https://github.com/PyCQA/flake8
rev: 7.3.0
hooks:
- id: flake8
args: [--max-line-length=119]
- id: rumdl
- id: rumdl-fmt
- repo: https://github.com/codespell-project/codespell
rev: v2.4.3
hooks:
Expand Down
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
# Briefcase Bootstrap template

A template for starting a Python app that will be deployed using
Briefcase.
A template for starting a Python app that will be deployed using Briefcase.

## Using this template

In normal usage, you won't need to reference this template at all - it
is used automatically by Briefcase when you run `briefcase new`.
In normal usage, you won't need to reference this template at all - it is used automatically by Briefcase when you run `briefcase new`.

If you are developing a modification to this template and want to test
it, you can tell Briefcase to use your own template by passing in the
`-t` option:
If you are developing a modification to this template and want to test it, you can tell Briefcase to use your own template by passing in the `-t` option:

```sh
briefcase new -t <path to checkout>
```

Alternatively, if you want to test this template *without* using
Briefcase, you can use
[cookiecutter](http://github.com/cookiecutter/cookiecutter) directly.
Alternatively, if you want to test this template *without* using Briefcase, you can use [cookiecutter](http://github.com/cookiecutter/cookiecutter) directly.

1. Install [cookiecutter](http://github.com/cookiecutter/cookiecutter):

1. Install [cookiecutter](http://github.com/cookiecutter/cookiecutter):
```sh
pip install cookiecutter
```

2. Run `cookiecutter` on this template:
2. Run `cookiecutter` on this template:

```sh
cookiecutter https://github.com/beeware/briefcase-template
```

3. Add your code to the project.
3. Add your code to the project.
2 changes: 1 addition & 1 deletion hooks/pre_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
app_name = "{{ cookiecutter.app_name }}"

if not re.match(PEP508_NAME_RE, app_name):
print("ERROR: `%s` is not a valid Python package name!" % app_name)
print(f"ERROR: `{app_name}` is not a valid Python package name!")

# exits with status 1 to indicate failure
sys.exit(1)
67 changes: 65 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[project]
name = "briefcase-template"
version = "1.0.0"
requires_python = ">=3.10"

[dependency-groups]
briefcase = [
"briefcase @ git+https://github.com/beeware/briefcase", # provides cookiecutter
Expand All @@ -6,15 +11,18 @@ pre-commit = [
"pre-commit == 4.6.0",
]
tox = [
"tox == 4.56.4",
"tox-uv == 1.35.2",
]
verify = [
"toml == 0.10.2",
"ruff == 0.16.0",
# Legacy; needed until we clean up .github
"flake8 == 7.3.0",
]
create-verify = [
"black == 26.5.1",
{include-group = "verify"},
# Legacy; needed until we clean up .github
"black == 26.5.1",
]
test = [
"pytest == 9.1.1",
Expand All @@ -27,3 +35,58 @@ dev = [
{include-group = "tox"},
{include-group = "test"},
]


[tool.ruff.lint]
# In addition to the default rules, these additional rules will be used:
extend-select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # pyflakes
"UP", # pyupgrade
"B", # flake8-bugbear
"YTT", # flake8-2020
"ASYNC", # flake8-async
"C4", # flake8-comprehensions
"I", # isort
"RUF", # ruff-specific rules
"PT", # flake8-pytest-style
"FURB", # refurb
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"SIM", # flake8-simplify
]

ignore = [
"SIM105", # use `contextlib.suppress` (too opinionated)
"SIM108", # replace if-else with ternary operator (too opinionated)
]

[tool.rumdl]
flavor = "mkdocs"
include = ["**/*.md"]
exclude = ["CODE_OF_CONDUCT.md"]
respect-gitignore = true
force-exclude = true

# Disable rules:
# MD013: Line length - flagging on mkdocstrings content
# MD014: Forces commands in codeblocks to show output
# MD042: Empty link - buggy, still flagging on valid MkDocs formatting
# MD052: Reference link not found - buggy, flagging on valis MkDocs links
disable = ["MD014", "MD042", "MD052"]

[tool.rumdl.MD013] # Line length
line_length = 999999 # Force reflow to paragraph content to remove linebreaks
reflow = true
reflow_mode = "normalize"

[tool.rumdl.MD026] # Remove punctuation at the end of headings
punctuation = ",;:"

[tool.rumdl.MD033] # No inline HTML
allowed_elements = ["nospell",] # pyspelling inline disable tag

[tool.rumdl.MD046]
style = "fenced"
Loading