diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b9651ec..89ffd18 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,8 @@ +exclude: | + (?x)^( + {{cookiecutter.project_slug}}/tests/test_import.py + )$ + repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.2.0 @@ -71,7 +76,9 @@ repos: --fail-under=40, --config, pyproject.toml, - "{{cookiecutter.project_slug}}" + "{{cookiecutter.project_slug}}", + --exclude, + "{{cookiecutter.project_slug}}/tests/test_import.py" ] pass_filenames: false - repo: https://github.com/executablebooks/mdformat diff --git a/docs/source/changes.md b/docs/source/changes.md index 9768812..777115a 100644 --- a/docs/source/changes.md +++ b/docs/source/changes.md @@ -3,7 +3,11 @@ This is a record of all past cookiecutter-pytask-project releases and what went into them in reverse chronological order. -## 1.2.0 - 2022-xx-xx +## 1.2.1 - 2022-05-13 + +- {pull}`20` fixes some small rendering issues. + +## 1.2.0 - 2022-04-14 - {pull}`7` skips concurrent CI builds. - {pull}`8` harmonizes cookiecutter-pytask-project with econ-project-templates. diff --git a/tests/test_cookie.py b/tests/test_cookie.py index 8844dd5..5f3eb0b 100644 --- a/tests/test_cookie.py +++ b/tests/test_cookie.py @@ -108,12 +108,21 @@ def test_check_conda_environment_creation_and_run_all_checks(cookies): check=True, ) - # Test building documentation + # Install package. subprocess.run( ("conda", "run", "-n", "__test__", "pip", "install", "-e", "."), cwd=result.project_path, check=True, ) + + # Run tests. + subprocess.run( + ("conda", "run", "-n", "__test__", "pytest"), + cwd=result.project_path, + check=True, + ) + + # Test building documentation subprocess.run( ("conda", "run", "-n", "__test__", "make", "html"), cwd=result.project_path / "docs", diff --git a/{{cookiecutter.project_slug}}/CITATION b/{{cookiecutter.project_slug}}/CITATION index 808818f..b171567 100644 --- a/{{cookiecutter.project_slug}}/CITATION +++ b/{{cookiecutter.project_slug}}/CITATION @@ -1,5 +1,5 @@ @Unpublished{{ "{" }}{{ cookiecutter.project_slug }}{% now 'local', '%Y' %}, - Title = {{ "{" }}A Python tool for managing scientific workflows.{{ "}" }}, + Title = {{ "{" }}{{ cookiecutter.project_description }}{{ "}" }}, Author = {{ "{" }}{{ cookiecutter.author }}{{ "}" }}, Year = {{ "{" }}{% now 'local', '%Y' %}{{ "}" }}, Url = {{ "{" }}https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}{{ "}" }} diff --git a/{{cookiecutter.project_slug}}/MANIFEST.in b/{{cookiecutter.project_slug}}/MANIFEST.in index 5886e61..95e45be 100644 --- a/{{cookiecutter.project_slug}}/MANIFEST.in +++ b/{{cookiecutter.project_slug}}/MANIFEST.in @@ -1,5 +1,5 @@ include CITATION -{% if cookiecutter.open_source_license == 'Not open source' %}include LICENSE +{% if cookiecutter.open_source_license != 'Not open source' %}include LICENSE {% endif %} exclude *.yaml exclude *.yml diff --git a/{{cookiecutter.project_slug}}/README.md b/{{cookiecutter.project_slug}}/README.md index 635c2ab..11c2eb9 100644 --- a/{{cookiecutter.project_slug}}/README.md +++ b/{{cookiecutter.project_slug}}/README.md @@ -22,23 +22,19 @@ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}/main) To get started, create the environment with -.. code-block:: console - -``` +```console $ conda/mamba env create ``` To build the project, type -.. code-block:: console - -``` +```console $ pytask ``` ## Credits -This project was created with `cookiecutter `\_ +This project was created with [cookiecutter](https://github.com/audreyr/cookiecutter) and the -`cookiecutter-pytask-project `\_ +[cookiecutter-pytask-project](https://github.com/pytask-dev/cookiecutter-pytask-project) template. diff --git a/{{cookiecutter.project_slug}}/setup.cfg b/{{cookiecutter.project_slug}}/setup.cfg index a10a8ad..55a8faf 100644 --- a/{{cookiecutter.project_slug}}/setup.cfg +++ b/{{cookiecutter.project_slug}}/setup.cfg @@ -1,14 +1,14 @@ [metadata] name = {{ cookiecutter.project_slug }} -description = A project with pytask. -long_description = file: README.rst -long_description_content_type = text/x-rst +description = {{ cookiecutter.project_description }} +long_description = file: README.md +long_description_content_type = text/markdown url = hhttps://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }} author = {{ cookiecutter.author }} author_email = {{ cookiecutter.email }} license = {{ cookiecutter.open_source_license }} -license_file = LICENSE -platforms = unix, linux, osx, cygwin, win32 +{% if cookiecutter.open_source_license != 'Not open source' %}license_file = LICENSE +{% endif %}platforms = unix, linux, osx, cygwin, win32 classifiers = Intended Audience :: Science/Research License :: OSI Approved :: {{ cookiecutter.open_source_license }} License diff --git a/{{cookiecutter.project_slug}}/tests/test_import.py b/{{cookiecutter.project_slug}}/tests/test_import.py new file mode 100644 index 0000000..98c0697 --- /dev/null +++ b/{{cookiecutter.project_slug}}/tests/test_import.py @@ -0,0 +1,7 @@ +from __future__ import annotations + +import {{ cookiecutter.project_slug }} + + +def test_import(): + assert hasattr({{ cookiecutter.project_slug }}, "__version__")