This repository has been archived by the owner on Jan 25, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Add pre commit, and applied other project configuration updates #34
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a736329
Added pre-commit, and updated other project configurations.
freakboy3742 77f65d1
Apply pre-commit.
freakboy3742 05d31fc
Added git-blame-ignore for black changes.
freakboy3742 eafb22d
Add a changenote.
freakboy3742 dd337e3
Add a documentation note about the use of pre-commit and towncrier.
freakboy3742 70b79e2
Updates picked up by a second pass of pre-commit.
freakboy3742 59b1ea1
Hard pin build system requirements.
freakboy3742 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Initial application of pre-commit (including Black) | ||
77f65d1a2ebbb8593e6968ce1af212693b074c93 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,41 +7,21 @@ on: | |
workflow_call: | ||
|
||
jobs: | ||
beefore: | ||
name: Pre-test checks | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
task: | ||
- 'flake8' | ||
- 'towncrier-check' | ||
- 'package' | ||
steps: | ||
# Fetch main branch for comparison, then check out current branch. | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: main | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: 3.X | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade setuptools | ||
python -m pip install tox | ||
- name: Run pre-test check | ||
run: | | ||
tox -e ${{ matrix.task }} | ||
pre-commit: | ||
name: Pre-commit checks | ||
uses: beeware/.github/.github/workflows/pre-commit-run.yml@main | ||
|
||
towncrier: | ||
name: Check towncrier | ||
uses: beeware/.github/.github/workflows/towncrier-run.yml@main | ||
|
||
package: | ||
name: Python Package | ||
uses: beeware/.github/.github/workflows/python-package-create.yml@main | ||
|
||
python-versions: | ||
unit-tests: | ||
name: Python compatibility test | ||
needs: beefore | ||
needs: [pre-commit, towncrier, package] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
|
@@ -53,16 +33,28 @@ jobs: | |
experimental: true | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
|
||
- name: Get packages | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ needs.package.outputs.artifact-name }} | ||
path: dist | ||
|
||
- name: Install dev dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade setuptools | ||
python -m pip install tox | ||
# We don't actually want to install travertino; | ||
# we just want the dev extras so we have a known version of tox. | ||
python -m pip install $(ls dist/travertino-*.whl)[dev] | ||
|
||
- name: Test | ||
run: | | ||
tox -e py | ||
tox -e py --installpkg dist/travertino-*.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Update pre-commit | ||
|
||
on: | ||
schedule: | ||
- cron: "0 20 * * SUN" # Sunday @ 2000 UTC | ||
workflow_dispatch: | ||
|
||
jobs: | ||
pre-commit-update: | ||
name: Update pre-commit | ||
uses: beeware/.github/.github/workflows/pre-commit-update.yml@main | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,25 +5,18 @@ on: | |
types: published | ||
|
||
jobs: | ||
publish: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade setuptools | ||
python -m pip install tox | ||
- name: Build release artefacts | ||
run: | | ||
tox -e package | ||
- name: Publish release | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
tox -e publish | ||
- uses: dsaltares/[email protected] | ||
with: | ||
version: tags/${{ github.event.release.tag_name }} | ||
# This next line is *not* a bash filename expansion - it's a regex. | ||
file: travertino.* | ||
regex: true | ||
target: dist/ | ||
|
||
- name: Publish release to production PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,22 +3,66 @@ name: Create Release | |
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
- "v*" | ||
|
||
jobs: | ||
ci: | ||
uses: ./.github/workflows/ci.yml | ||
|
||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
needs: ci | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
- name: Set build variables | ||
run: | | ||
echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV | ||
|
||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.X" | ||
|
||
- name: Get packages | ||
uses: actions/[email protected] | ||
with: | ||
name: packages | ||
path: dist | ||
|
||
- name: Install packages | ||
run: pip install dist/travertino-*.whl | ||
|
||
- name: Check version number | ||
# Check that the setuptools_scm-generated version number is still the same when | ||
# installed from a wheel with setuptools_scm not present. | ||
run: | | ||
set -x | ||
test $(python -c "from travertino import __version__; print(__version__)") = $VERSION | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: ncipollo/[email protected] | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
name: ${{ env.VERSION }} | ||
draft: true | ||
prerelease: false | ||
artifacts: dist/* | ||
artifactErrorsFailBuild: true | ||
|
||
test-publish: | ||
name: Publish test package | ||
needs: [release] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Get packages | ||
uses: actions/[email protected] | ||
with: | ||
name: packages | ||
path: dist | ||
|
||
- name: Publish release to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository_url: https://test.pypi.org/legacy/ | ||
password: ${{ secrets.TEST_PYPI_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,3 @@ distribute-* | |
venv | ||
.idea | ||
pip-wheel-metadata | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
additional_dependencies: [toml] | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.3.1 | ||
hooks: | ||
- id: pyupgrade | ||
args: [--py37-plus] | ||
- repo: https://github.com/psf/black | ||
rev: 23.1.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
# Contributing | ||
|
||
PyBee <3's contributions! | ||
BeeWare <3's contributions! | ||
|
||
Please be aware, PyBee operates under a Code of Conduct. | ||
|
||
See [CONTRIBUTING to PyBee](http://pybee.org/contributing) for details. | ||
Please be aware, BeeWare operates under a Code of Conduct. | ||
|
||
See [CONTRIBUTING to BeeWare](https://beeware.org/contributing) for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Details on towncrier and pre-commit ussage were added to the README. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Corrected some spelling errors. | ||
Corrected some spelling errors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Node now supports the `clear` method in order to clear all children. | ||
Node now supports the ``clear`` method in order to clear all children. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Flake8 should ignore the venv directory when running. | ||
Flake8 should ignore the venv directory when running. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Drop python 3.5 support! | ||
Drop python 3.5 support! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Upgrade all codebase to use format-strings | ||
Upgrade all codebase to use format-strings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Pre-commit was added to the codebase. This introduces black as a coding style. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools >= 43.0.0", | ||
"wheel >= 0.32.0", | ||
] | ||
requires = ["setuptools>=60", "setuptools_scm[toml]>=7.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.isort] | ||
profile = "black" | ||
split_on_trailing_comma = true | ||
combine_as_imports = true | ||
|
||
[tool.setuptools_scm] | ||
# To enable SCM versioning, we need an empty tool configuration for setuptools_scm | ||
|
||
[tool.towncrier] | ||
directory = "changes" | ||
package = "travertino" | ||
filename = "CHANGELOG.rst" | ||
title_format = "{version} ({project_date})" | ||
issue_format = "`#{issue} <https://github.com/beeware/travertino/issues/{issue}>`_" | ||
template = "changes/template.rst" | ||
underlines = ["-", "^", "\""] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reproducibility, I think it's better for this section to pin exact version numbers, as I did in Toga.