diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 56adc17..e958ff8 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,7 +1,7 @@ --- name: Bug Report -about: Create a bug report to help us improve cookiecutter-pytask +about: Create a bug report to help us improve cookiecutter-pytask-project title: "BUG:" labels: "bug" @@ -9,10 +9,10 @@ labels: "bug" - [ ] I have checked that this issue has not already been reported. -- [ ] I have confirmed this bug exists on the latest version of cookiecutter-pytask. +- [ ] I have confirmed this bug exists on the latest version of cookiecutter-pytask-project. - [ ] (optional) I have confirmed this bug exists on the `main` branch of - cookiecutter-pytask. + cookiecutter-pytask-project. --- diff --git a/.github/ISSUE_TEMPLATE/enhancement.md b/.github/ISSUE_TEMPLATE/enhancement.md index 3d450e7..22e9079 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.md +++ b/.github/ISSUE_TEMPLATE/enhancement.md @@ -1,7 +1,7 @@ --- name: Enhancement -about: Suggest an idea for cookiecutter-pytask +about: Suggest an idea for cookiecutter-pytask-project title: "ENH:" labels: "enhancement" @@ -10,7 +10,7 @@ labels: "enhancement" #### Is your feature request related to a problem? Provide a description of what the problem is, e.g. "I wish I could use -cookiecutter-pytask to do [...]". +cookiecutter-pytask-project to do [...]". #### Describe the solution you'd like diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 7bcfa8c..ecfad60 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -1,7 +1,7 @@ --- name: Submit Question -about: Ask a general question about cookiecutter-pytask +about: Ask a general question about cookiecutter-pytask-project title: "QST:" labels: "question" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7757402..c1362b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,29 +34,9 @@ jobs: shell: bash -l {0} run: conda install -c conda-forge tox-conda coverage - # Unit, integration, and end-to-end tests. - - # - name: Run unit tests and doctests. - # shell: bash -l {0} - # run: tox -e pytest -- "\{\{cookiecutter.project_slug\}\}" tests -m "unit or (not integration and not end_to_end)" --cov=./ --cov-report=xml -n auto - - # - name: Upload coverage report for unit tests and doctests. - # if: runner.os == 'Linux' && matrix.python-version == '3.8' - # shell: bash -l {0} - # run: bash <(curl -s https://codecov.io/bash) -F unit -c - - # - name: Run integration tests. - # shell: bash -l {0} - # run: tox -e pytest -- "\{\{cookiecutter.project_slug\}\}" tests -m integration --cov=./ --cov-report=xml -n auto - - # - name: Upload coverage reports of integration tests. - # if: runner.os == 'Linux' && matrix.python-version == '3.8' - # shell: bash -l {0} - # run: bash <(curl -s https://codecov.io/bash) -F integration -c - - name: Run end-to-end tests. shell: bash -l {0} - run: tox -e pytest -- "\{\{cookiecutter.project_slug\}\}" tests -m end_to_end --cov=./ --cov-report=xml -n auto + run: tox -e pytest -- tests -m end_to_end --cov=./ --cov-report=xml -n auto - name: Upload coverage reports of end-to-end tests. if: runner.os == 'Linux' && matrix.python-version == '3.8' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0023f59..f03099d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,10 +37,6 @@ repos: rev: v2.6.0 hooks: - id: reorder-python-imports -- repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.0 - hooks: - - id: setup-cfg-fmt - repo: https://github.com/psf/black rev: 21.12b0 hooks: diff --git a/CHANGES.rst b/CHANGES.rst index 5cf707e..745cd89 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,8 +1,16 @@ Changes ======= -This is a record of all past cookiecutter-pytask releases and what went into them in -reverse chronological order. +This is a record of all past cookiecutter-pytask-project releases and what went into +them in reverse chronological order. + + +1.1.0 - 2022-01-16 +------------------ + +- :gh:`4` renames the cookiecutter from cookiecutter-pytask to + cookiecutter-pytask-project to avoid confusion with the cookiecutter for plugins. And + remove unnecessary packaging stuff. 1.0.0 - 2021-01-05 diff --git a/README.rst b/README.rst index 93993fb..1c0c833 100644 --- a/README.rst +++ b/README.rst @@ -1,21 +1,21 @@ -cookiecutter-pytask -=================== +cookiecutter-pytask-project +=========================== -.. image:: https://img.shields.io/github/license/pytask-dev/cookiecutter-pytask +.. image:: https://img.shields.io/github/license/pytask-dev/cookiecutter-pytask-project :alt: MIT license :target: https://pypi.org/project/pytask -.. image:: https://readthedocs.org/projects/cookiecutter-pytask/badge/?version=latest - :target: https://cookiecutter-pytask.readthedocs.io/en/latest +.. image:: https://readthedocs.org/projects/cookiecutter-pytask-project/badge/?version=latest + :target: https://cookiecutter-pytask-project.readthedocs.io/en/latest -.. image:: https://img.shields.io/github/workflow/status/pytask-dev/cookiecutter-pytask/main/main - :target: https://github.com/pytask-dev/cookiecutter-pytask/actions?query=branch%3Amain +.. image:: https://img.shields.io/github/workflow/status/pytask-dev/cookiecutter-pytask-project/main/main + :target: https://github.com/pytask-dev/cookiecutter-pytask-project/actions?query=branch%3Amain -.. image:: https://codecov.io/gh/pytask-dev/cookiecutter-pytask/branch/main/graph/badge.svg - :target: https://codecov.io/gh/pytask-dev/cookiecutter-pytask +.. image:: https://codecov.io/gh/pytask-dev/cookiecutter-pytask-project/branch/main/graph/badge.svg + :target: https://codecov.io/gh/pytask-dev/cookiecutter-pytask-project -.. image:: https://results.pre-commit.ci/badge/github/pytask-dev/cookiecutter-pytask/main.svg - :target: https://results.pre-commit.ci/latest/github/pytask-dev/cookiecutter-pytask/main +.. image:: https://results.pre-commit.ci/badge/github/pytask-dev/cookiecutter-pytask-project/main.svg + :target: https://results.pre-commit.ci/latest/github/pytask-dev/cookiecutter-pytask-project/main :alt: pre-commit.ci status .. image:: https://img.shields.io/badge/code%20style-black-000000.svg @@ -41,7 +41,7 @@ Then, set up the template with .. code-block:: console - $ cookiecutter https://github.com/pytask-dev/cookiecutter-pytask + $ cookiecutter https://github.com/pytask-dev/cookiecutter-pytask-project FAQ diff --git a/docs/rtd_environment.yml b/docs/rtd_environment.yml index a0ccb12..1867ea9 100644 --- a/docs/rtd_environment.yml +++ b/docs/rtd_environment.yml @@ -17,6 +17,3 @@ dependencies: - sphinx-click - sphinx-copybutton - sphinx-panels - - - pip: - - -e .. diff --git a/docs/source/conf.py b/docs/source/conf.py index b48c903..4e6a941 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -4,18 +4,16 @@ documentation: https://www.sphinx-doc.org/en/master/usage/configuration.html """ -from importlib.metadata import version - # -- Project information ----------------------------------------------------- -project = "cookiecutter-pytask" +project = "cookiecutter-pytask-project" author = "Tobias Raabe" copyright = f"2021, {author}" # noqa: A001 # The version, including alpha/beta/rc tags, but not commit hash and datestamps -release = version("cookiecutter-pytask") +release = "1.1.0" # The short X.Y version. -version = ".".join(release.split(".")[:2]) +version = "1.1" # -- General configuration --------------------------------------------------- diff --git a/docs/source/index.rst b/docs/source/index.rst index 59dbd0f..669b16e 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,4 +1,4 @@ -Welcome to cookiecutter-pytask's documentation! -=============================================== +Welcome to cookiecutter-pytask-project's documentation! +======================================================= .. include:: ../../README.rst diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index a75e87c..6cf1f89 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -46,13 +46,6 @@ def main(): if "{{ cookiecutter.make_initial_commit }}" == "yes": # Create an initial commit on the main branch and restore global default name. - p = subprocess.run( - ("git", "config", "init.defaultBranch"), check=True, capture_output=True - ) - old_branch_default = p.stdout.decode().strip() - subprocess.run( - ("git", "config", "--global", "init.defaultBranch", "main"), check=True - ) subprocess.run( ("git", "config", "user.name", "'{{ cookiecutter.github_username }}'"), check=True, @@ -67,10 +60,7 @@ def main(): check=True, capture_output=True, ) - subprocess.run( - ("git", "config", "--global", "init.defaultBranch", old_branch_default), - check=True, - ) + subprocess.run(("git", "branch", "-m", "main"), check=True) if "{{ cookiecutter.create_conda_environment_at_finish }}" == "yes": if shutil.which("mamba") is not None: diff --git a/pyproject.toml b/pyproject.toml index 71aabb6..7ff617a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,10 @@ -[build-system] -requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"] - - -[tool.setuptools_scm] -write_to = "version.py" - - [tool.tryceratops] ignore = ["TC003"] [tool.mypy] files = ["{{cookiecutter.project_slug}}", "tests"] +exclude = "{{cookiecutter.project_slug}}/tests" check_untyped_defs = true disallow_any_generics = true disallow_incomplete_defs = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 3d4e4cf..0000000 --- a/setup.cfg +++ /dev/null @@ -1,39 +0,0 @@ -[metadata] -name = cookiecutter_pytask -description = A minimal template for projects with pytask. -long_description = file: README.rst -long_description_content_type = text/x-rst -url = https://cookiecutter-pytask.readthedocs.io/en/latest -author = Tobias Raabe -author_email = raabe@posteo.de -license = MIT -license_file = LICENSE -platforms = unix, linux, osx, cygwin, win32 -classifiers = - Development Status :: 3 - Alpha - Intended Audience :: Science/Research - License :: OSI Approved :: MIT License - Operating System :: MacOS :: MacOS X - Operating System :: Microsoft :: Windows - Operating System :: POSIX - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Topic :: Scientific/Engineering -project_urls = - Changelog = https://cookiecutter-pytask.readthedocs.io/en/latest/changes.html - Documentation = https://cookiecutter-pytask.readthedocs.io/en/latest - Github = https://github.com/pytask-dev/cookiecutter-pytask - Tracker = https://github.com/pytask-dev/cookiecutter-pytask/issues - -[options] -python_requires = >=3.6 -zip_safe = False - -[check-manifest] -ignore = - version.py diff --git a/setup.py b/setup.py deleted file mode 100644 index 26e08e4..0000000 --- a/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -from setuptools import setup - - -if __name__ == "__main__": - setup() diff --git a/tests/test_cookie.py b/tests/test_cookie.py index f6d22f0..e4c99c2 100644 --- a/tests/test_cookie.py +++ b/tests/test_cookie.py @@ -93,6 +93,7 @@ def test_check_conda_environment_creation_and_run_all_checks(cookies): result = cookies.bake( extra_context={ "conda_environment_name": "__test__", + "make_initial_commit": "yes", "create_conda_environment_at_finish": "yes", } ) @@ -107,7 +108,12 @@ def test_check_conda_environment_creation_and_run_all_checks(cookies): ("git", "checkout", "-b", "test"), cwd=result.project_path, check=True ) - # Do not check exit code on Windows since something weird happens. + # Check linting, but not on the first try since formatters fix stuff. + subprocess.run( + ("conda", "run", "-n", "__test__", "pre-commit", "run", "--all-files"), + cwd=result.project_path, + check=False, + ) subprocess.run( ("conda", "run", "-n", "__test__", "pre-commit", "run", "--all-files"), cwd=result.project_path, diff --git a/tox.ini b/tox.ini index f8f549f..74971ca 100644 --- a/tox.ini +++ b/tox.ini @@ -50,10 +50,6 @@ ignore = W503 ; ignore linebreak before binary operator which is enforced by Black. PT006 ; ignore that parametrizing tests with tuple argument names is preferred. max-line-length = 88 -per-file-ignores = - src/_pytask/hookspecs.py: U100 - src/_pytask/outcomes.py: N818 - tests/test_capture.py: T000, T001, N802, PT011 pytest-mark-no-parentheses = true warn-symbols = pytest.mark.wip = Remove 'wip' mark for tests. diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index c49daac..f685c7e 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -78,8 +78,7 @@ repos: rev: 1.5.0 hooks: - id: interrogate - args: [-v, --fail-under=40, "{{cookiecutter.project_slug}}"] - pass_filenames: false + args: [-v, --fail-under=40] - repo: https://github.com/codespell-project/codespell rev: v2.1.0 hooks: diff --git a/{{cookiecutter.project_slug}}/README.rst b/{{cookiecutter.project_slug}}/README.rst index 17b0da7..964e06d 100644 --- a/{{cookiecutter.project_slug}}/README.rst +++ b/{{cookiecutter.project_slug}}/README.rst @@ -39,5 +39,5 @@ Credits ------- This project was created with `cookiecutter `_ -and the `cookiecutter-pytask `_ +and the `cookiecutter-pytask-project `_ template. diff --git a/{{cookiecutter.project_slug}}/environment.yml b/{{cookiecutter.project_slug}}/environment.yml index 3f4a743..581a0e0 100644 --- a/{{cookiecutter.project_slug}}/environment.yml +++ b/{{cookiecutter.project_slug}}/environment.yml @@ -32,6 +32,3 @@ dependencies: - sphinx-click - sphinx-copybutton - sphinx-panels - - - pip: - - -e . diff --git a/{{cookiecutter.project_slug}}/tests/__init__.py b/{{cookiecutter.project_slug}}/tests/__init__.py new file mode 100644 index 0000000..e69de29