diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 16f0b36..58e2471 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,17 +30,17 @@ jobs: python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/checkout@v3 + - uses: mamba-org/provision-with-micromamba@main with: - auto-update-conda: false - python-version: ${{ matrix.python-version }} + environment-file: false + environment-name: gha-testing channels: conda-forge,nodefaults - mamba-version: "*" - - - name: Install core dependencies. - shell: bash -l {0} - run: mamba install -c conda-forge tox-conda coverage + extra-specs: | + python=${{ matrix.python-version }} + mamba + tox-conda + cache-downloads: true - name: Run end-to-end tests. shell: bash -l {0} @@ -58,14 +58,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/checkout@v3 + - uses: mamba-org/provision-with-micromamba@main with: - auto-update-conda: false - - - name: Install core dependencies. - shell: bash -l {0} - run: conda install -c conda-forge tox-conda + environment-file: false + environment-name: gha-docs + channels: conda-forge,nodefaults + extra-specs: | + python=3.11 + mamba + tox-conda + cache-downloads: true - name: Build docs shell: bash -l {0} diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index dbcbc76..c8c4955 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -60,18 +60,30 @@ def main() -> None: ) if "{{ cookiecutter.create_conda_environment_at_finish }}" == "yes": + if shutil.which("mamba") is not None: conda_exe = shutil.which("mamba") else: conda_exe = shutil.which("conda") - if conda_exe is None: + if conda_exe: + subprocess.run( + ( + conda_exe, + "env", + "create", + "-f", + (project_path / "environment.yml").absolute().as_posix(), + "--force", + ), + check=True, + capture_output=True, + ) + else: warnings.warn( "conda environment could not be created since no conda or mamba " "executable was found." ) - else: - subprocess.run((conda_exe, "env", "create"), check=True) if __name__ == "__main__": diff --git a/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/bug_report.md b/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/bug_report.md index e663479..364c6af 100644 --- a/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/bug_report.md +++ b/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,7 +1,7 @@ --- name: Bug Report -about: Create a bug report to help us improve {{ cookiecutter.project_slug }} +about: Create a bug report to help us improve {{ cookiecutter.project_name }} title: "BUG:" labels: "bug" @@ -10,10 +10,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.project_slug }}. + cookiecutter.project_name }}. - [ ] (optional) I have confirmed this bug exists on the `main` branch of {{ - cookiecutter.project_slug }}. + cookiecutter.project_name }}. --- diff --git a/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/documentation.md b/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/documentation.md index 9747ee7..03b2a05 100644 --- a/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/documentation.md +++ b/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/documentation.md @@ -1,7 +1,7 @@ --- name: Documentation Improvement -about: Report wrong or missing documentation +about: Report wrong or missing documentation in {{ cookiecutter.project_name }} title: "DOC:" labels: "documentation" diff --git a/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/enhancement.md b/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/enhancement.md index 980702f..e308e42 100644 --- a/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/enhancement.md +++ b/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/enhancement.md @@ -1,7 +1,7 @@ --- name: Enhancement -about: Suggest an idea for {{ cookiecutter.project_slug }} +about: Suggest an idea for {{ cookiecutter.project_name }} 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.project_slug }} to do [...]". +{{ cookiecutter.project_name }} to do [...]". #### Describe the solution you'd like diff --git a/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/question.md b/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/question.md index 7049900..ec2ca08 100644 --- a/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/question.md +++ b/{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/question.md @@ -1,13 +1,13 @@ --- name: Submit Question -about: Ask a general question about {{ cookiecutter.project_slug }} +about: Ask a general question about {{ cookiecutter.project_name }} title: "QST:" labels: "question" --- -#### Question about pytask +#### Question about {{ cookiecutter.project_name }} **Note**: If you'd still like to submit a question, please read [this guide]( https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to diff --git a/{{cookiecutter.project_slug}}/.github/workflows/main.yml b/{{cookiecutter.project_slug}}/.github/workflows/main.yml index 090a0ac..eeb92d6 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/main.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/main.yml @@ -30,17 +30,17 @@ jobs: python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/checkout@v3 + - uses: mamba-org/provision-with-micromamba@main with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} + environment-file: false + environment-name: gha-testing channels: conda-forge,nodefaults - mamba-version: "*" - - - name: Install core dependencies. - shell: bash -l {0} - run: mamba install -c conda-forge tox-conda coverage + extra-specs: | + python=${{ matrix.python-version }} + mamba + tox-conda + cache-downloads: true # Unit, integration, and end-to-end tests. @@ -78,14 +78,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/checkout@v3 + - uses: mamba-org/provision-with-micromamba@main with: - auto-update-conda: true - - - name: Install core dependencies. - shell: bash -l {0} - run: conda install -c conda-forge tox-conda + environment-file: false + environment-name: gha-docs + channels: conda-forge,nodefaults + extra-specs: | + python=3.11 + mamba + tox-conda + cache-downloads: true - name: Build docs shell: bash -l {0} diff --git a/{{cookiecutter.project_slug}}/setup.cfg b/{{cookiecutter.project_slug}}/setup.cfg index 946db6a..39f8479 100644 --- a/{{cookiecutter.project_slug}}/setup.cfg +++ b/{{cookiecutter.project_slug}}/setup.cfg @@ -3,7 +3,7 @@ name = {{ cookiecutter.project_slug }} 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 }} +url = https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }} author = {{ cookiecutter.author }} author_email = {{ cookiecutter.email }} license = {{ cookiecutter.open_source_license }} @@ -19,7 +19,7 @@ classifiers = Programming Language :: Python :: 3 :: Only project_urls = Changelog = https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }} - Documentation = hhttps://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }} + Documentation = https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }} Github = https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }} Tracker = https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}/issues