-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
166 additions
and
126 deletions.
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
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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"email": "[email protected]", | ||
"github_username": "fedejaure", | ||
"project_name": "modern-python-boilerplate", | ||
"project_slug": "{{ cookiecutter.project_name.lower().replace('-', '_').replace('-', '_') }}", | ||
"project_slug": "{{ cookiecutter.project_name.lower().replace('-', '_') }}", | ||
"project_title": "{{ cookiecutter.project_name.replace('-', ' ').title() }}", | ||
"project_short_description": "Python Boilerplate contains all the boilerplate you need to create a modern Python package.", | ||
"version": "0.1.0", | ||
|
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,2 +1,2 @@ | ||
sphinx==4.0.2 | ||
sphinx==4.1.1 | ||
recommonmark==0.7.1 |
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
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "cookiecutter-modern-pypackage" | ||
version = "2.0.0" | ||
version = "2.0.1" | ||
description = "Cookiecutter template for a modern Python package." | ||
authors = ["Federico Jaureguialzo <[email protected]>"] | ||
license = "MIT" | ||
|
@@ -33,7 +33,7 @@ python = "<3.10,>=3.7" | |
|
||
[tool.poetry.dev-dependencies] | ||
pre-commit = "^2.13.0" | ||
invoke = "^1.5.0" | ||
invoke = "^1.6.0" | ||
flake8 = "^3.9.2" | ||
flakehell = "^0.9.0" | ||
flake8-builtins = "^1.5.3" | ||
|
@@ -44,18 +44,18 @@ flake8-annotations = "^2.6.2" | |
flake8-docstrings = "^1.6.0" | ||
flake8-bandit = "^2.1.2" | ||
darglint = "^1.8.0" | ||
isort = "^5.8.0" | ||
black = "^21.5b2" | ||
isort = "^5.9.2" | ||
black = "^21.7b0" | ||
safety = "^1.10.3" | ||
mypy = "^0.902" | ||
sphinx = "^4.0.2" | ||
mypy = "^0.910" | ||
sphinx = "^4.1.1" | ||
recommonmark = "^0.7.1" | ||
bump2version = "^1.0.1" | ||
pytest = "^6.2.4" | ||
xdoctest = "^0.15.4" | ||
xdoctest = "^0.15.5" | ||
cookiecutter = "^1.7.3" | ||
pytest-cookies = "^0.6.1" | ||
watchdog = {version = "^2.1.2", extras = ["watchmedo"]} | ||
watchdog = {version = "^2.1.3", extras = ["watchmedo"]} | ||
|
||
[tool.flakehell] | ||
format = "grouped" | ||
|
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 |
---|---|---|
|
@@ -17,6 +17,10 @@ | |
COOKIE_CONTEXT_CLI = {"command_line_interface": "Click"} | ||
COOKIE_CONTEXT_BSD = {"open_source_license": "BSD"} | ||
COOKIE_CONTEXT_NO_CLI = {"command_line_interface": "No command-line interface"} | ||
COOKIE_CONTEXT_DIFF_NAME_AND_SLUG = { | ||
"project_name": "some-project-name", | ||
"project_slug": "some_project", | ||
} | ||
|
||
|
||
@contextmanager | ||
|
@@ -111,6 +115,11 @@ def _test_bake_and_run_invoke_tasks( | |
assert result.exit_code == 0 | ||
assert result.exception is None | ||
|
||
assert run_inside_dir("git init", str(result.project_path)) == 0 | ||
assert run_inside_dir("git add .", str(result.project_path)) == 0 | ||
assert run_inside_dir('git config user.email "[email protected]"', str(result.project_path)) == 0 | ||
assert run_inside_dir('git config user.name "Test User"', str(result.project_path)) == 0 | ||
assert run_inside_dir("git commit -m 'initial commit'", str(result.project_path)) == 0 | ||
assert run_inside_dir("poetry install", str(result.project_path)) == 0 | ||
for task in inv_tasks: | ||
assert run_inside_dir(f"poetry run inv {task}", str(result.project_path)) == 0 | ||
|
@@ -123,31 +132,20 @@ def _test_bake_and_run_invoke_tasks( | |
COOKIE_CONTEXT_NOT_OPEN_SOURCE, | ||
{**COOKIE_CONTEXT_NOT_OPEN_SOURCE, **COOKIE_CONTEXT_NO_CLI}, | ||
{**COOKIE_CONTEXT_CLI, **COOKIE_CONTEXT_BSD}, | ||
COOKIE_CONTEXT_DIFF_NAME_AND_SLUG, | ||
], | ||
) | ||
def test_bake_and_run_invoke(cookies: Cookies, extra_context: Dict[str, str]) -> None: | ||
"""Test bake the project and check invoke tasks.""" | ||
invoke_tasks = [ | ||
"install-hooks", | ||
"hooks", | ||
"clean", | ||
"lint", | ||
"mypy", | ||
"tests", | ||
"coverage", | ||
"version -d minor", | ||
"docs", | ||
] | ||
_test_bake_and_run_invoke_tasks(cookies, extra_context, invoke_tasks) | ||
|
||
|
||
@skip_on_windows | ||
@pytest.mark.parametrize( | ||
"extra_context", | ||
[ | ||
{}, | ||
COOKIE_CONTEXT_NOT_OPEN_SOURCE, | ||
{**COOKIE_CONTEXT_NOT_OPEN_SOURCE, **COOKIE_CONTEXT_NO_CLI}, | ||
{**COOKIE_CONTEXT_CLI, **COOKIE_CONTEXT_BSD}, | ||
], | ||
) | ||
def test_bake_and_build_docs(cookies: Cookies, extra_context: Dict[str, str]) -> None: | ||
"""Test bake the project and check invoke docs task.""" | ||
_test_bake_and_run_invoke_tasks(cookies, extra_context, ["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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{% raw %}name: release | ||
{% set is_open_source = cookiecutter.open_source_license != 'Not open source' %} | ||
name: release | ||
|
||
on: | ||
push: | ||
|
@@ -25,20 +26,21 @@ jobs: | |
- name: Build package | ||
run: | | ||
poetry build --ansi | ||
{% if is_open_source %}{% raw %} | ||
- name: Publish package on PyPI | ||
uses: pypa/[email protected].1 | ||
uses: pypa/[email protected].2 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
|
||
- name: Publish package on TestPyPI | ||
uses: pypa/[email protected].1 | ||
uses: pypa/[email protected].2 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
|
||
{% endraw %}{% endif %} | ||
{% raw %} | ||
github_release: | ||
needs: release | ||
name: Create Github Release | ||
|
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 |
---|---|---|
|
@@ -61,7 +61,7 @@ jobs: | |
run: nox --force-color -s safety | ||
|
||
- name: Upload coverage data | ||
uses: actions/[email protected].0 | ||
uses: actions/[email protected].4 | ||
with: | ||
name: coverage-data | ||
path: ".coverage.*" | ||
|
@@ -85,7 +85,7 @@ jobs: | |
poetry config virtualenvs.in-project true | ||
- name: Download coverage data | ||
uses: actions/[email protected].5 | ||
uses: actions/[email protected].10 | ||
with: | ||
name: coverage-data | ||
|
||
|
@@ -95,6 +95,6 @@ jobs: | |
nox --force-color --session=coverage -- --fmt xml | ||
- name: Upload coverage report | ||
uses: codecov/codecov-action@v1.3.1 | ||
uses: codecov/codecov-action@v2.0.2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }}{% endraw %} |
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
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,2 +1,2 @@ | ||
sphinx==4.0.2 | ||
sphinx==4.1.1 | ||
recommonmark==0.7.1 |
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