-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to modern build / package practices
* define pyproject.toml with tool configuration * define setuptools dependencies for test extras * update to a moder tox config based on attrs * configure RTD and coverage in standard ways * switch to an RST changelog and towncrier * check the manifest on CI The marquee change here is a switch to github actions, instead of Travis. While this commit won't turn off Travis, the one after it will.
- Loading branch information
Showing
10 changed files
with
369 additions
and
111 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,101 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ["master", "ci-testing"] | ||
|
||
pull_request: | ||
branches: ["master"] | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
tests: | ||
name: "Python ${{ matrix.python-version }}" | ||
runs-on: "ubuntu-latest" | ||
env: | ||
USING_COVERAGE: "3.7,3.8" | ||
|
||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.6" | ||
- "3.7" | ||
- "3.8" | ||
- "3.9" | ||
- "pypy2" | ||
# disabled due to one failing test | ||
# - "pypy3" | ||
|
||
steps: | ||
- uses: "actions/checkout@v2" | ||
- uses: "actions/setup-python@v2" | ||
with: | ||
python-version: "${{ matrix.python-version }}" | ||
- name: "Install dependencies" | ||
run: | | ||
set -xe | ||
python -VV | ||
python -msite | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions | ||
- name: "Run tox targets for ${{ matrix.python-version }}" | ||
run: "python -m tox" | ||
|
||
# We always use a modern Python version for combining coverage to prevent | ||
# parsing errors in older versions for modern code. | ||
- uses: "actions/setup-python@v2" | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: "Combine coverage" | ||
run: | | ||
set -xe | ||
python -m pip install coverage[toml] | ||
python -m coverage combine | ||
python -m coverage xml | ||
if: "contains(env.USING_COVERAGE, matrix.python-version)" | ||
- name: "Upload coverage to Codecov" | ||
if: "contains(env.USING_COVERAGE, matrix.python-version)" | ||
uses: "codecov/codecov-action@v1" | ||
with: | ||
fail_ci_if_error: true | ||
|
||
package: | ||
name: "Build & verify package" | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- uses: "actions/checkout@v2" | ||
- uses: "actions/setup-python@v1" | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: "Install pep517 and twine" | ||
run: "python -m pip install pep517 twine" | ||
- name: "Build package" | ||
run: "python -m pep517.build --source --binary ." | ||
- name: "List result" | ||
run: "ls -l dist" | ||
- name: "Check long_description" | ||
run: "python -m twine check dist/*" | ||
|
||
install-dev: | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | ||
|
||
name: "Verify dev env" | ||
runs-on: "${{ matrix.os }}" | ||
|
||
steps: | ||
- uses: "actions/checkout@v2" | ||
- uses: "actions/setup-python@v1" | ||
with: | ||
python-version: "3.8" | ||
- name: "Install in dev mode" | ||
run: "python -m pip install -e .[dev]" | ||
- name: "Import package" | ||
run: "python -c 'import hamcrest; print(hamcrest.__version__)'" |
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,11 @@ | ||
--- | ||
version: 2 | ||
python: | ||
# Keep version in sync with tox.ini (docs and gh-actions). | ||
version: 3.7 | ||
|
||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- docs |
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 |
---|---|---|
@@ -1,5 +1,26 @@ | ||
include CHANGES.txt | ||
include LICENSE.txt | ||
include README.md | ||
include LICENSE.txt *.rst *.md *.toml *.yml *.yaml *.ini | ||
include requirements-* | ||
graft .github | ||
|
||
# Tests | ||
include tox.ini conftest.py | ||
recursive-include tests *.py | ||
recursive-include tests *.yml | ||
|
||
# Documentation | ||
include doc/Makefile doc/docutils.conf | ||
recursive-include examples *.py | ||
recursive-include doc * | ||
recursive-include doc *.png | ||
recursive-include doc *.svg | ||
recursive-include doc *.py | ||
recursive-include doc *.rst | ||
prune doc/_build | ||
|
||
# remove some of the random source | ||
prune docker | ||
exclude release.sh | ||
|
||
# Just to keep check-manifest happy; on releases those files are gone. | ||
# Last rule wins! | ||
exclude changelog.d/*.rst | ||
include changelog.d/towncrier_template.rst |
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,20 @@ | ||
{% for section, _ in sections.items() %} {% set underline = underlines[0] %}{% if section %}{{section}} {{ underline * section|length }}{% set underline = underlines[1] %} | ||
|
||
{% endif %} | ||
|
||
{% if sections[section] %} {% for category, val in definitions.items() if category in sections[section]%} {{ definitions[category]['name'] }} {{ underline * definitions[category]['name']|length }} | ||
|
||
{% if definitions[category]['showcontent'] %} {% for text, values in sections[section][category].items() %} - {{ text }} | ||
|
||
{{ values|join(',n ') }} | ||
{% endfor %} | ||
|
||
{% else %} - {{ sections[section][category]['']|join(', ') }} | ||
|
||
{% endif %} {% if sections[section][category]|length == 0 %} No significant changes. | ||
|
||
{% else %} {% endif %} | ||
|
||
{% endfor %} {% else %} No significant changes. | ||
|
||
{% endif %} {% endfor %} ---- |
Oops, something went wrong.