Skip to content

Update GHA workflow #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
Expand Down
18 changes: 15 additions & 3 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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 }}.

---

Expand Down
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
35 changes: 19 additions & 16 deletions {{cookiecutter.project_slug}}/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_slug}}/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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

Expand Down