Skip to content

Commit

Permalink
Simplify github workflow file
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <[email protected]>
  • Loading branch information
gaborbernat committed Jul 24, 2022
1 parent 1f2b610 commit b795b97
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 59 deletions.
8 changes: 4 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Contributing to ``virtualenv``
# Contributing to `virtualenv`

Thank you for your interest in contributing to virtualenv! There are many ways to contribute, and we appreciate all of them.
As a reminder, all contributors are expected to follow the [PSF Code of Conduct][coc].
Thank you for your interest in contributing to virtualenv! There are many ways to contribute, and we appreciate all of
them. As a reminder, all contributors are expected to follow the [PSF Code of Conduct][coc].

[coc]: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md

## Development Documentation

Our [development documentation](https://virtualenv.pypa.io/en/latest/development.html#development) contains details on
how to get started with contributing to ``virtualenv``, and details of our development processes.
how to get started with contributing to `virtualenv`, and details of our development processes.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Describe what's the expected behaviour and what you're observing.
**Environment**

Provide at least:

- OS:
- ``pip list`` of the host python where ``virtualenv`` is installed:
- `pip list` of the host python where `virtualenv` is installed:

```console

Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
title: ""
labels: bug
assignees: ''

assignees: ""
---

**Issue**
Expand All @@ -14,8 +13,9 @@ Describe what's the expected behaviour and what you're observing.
**Environment**

Provide at least:

- OS:
- ``pip list`` of the host python where ``virtualenv`` is installed:
- `pip list` of the host python where `virtualenv` is installed:

```console

Expand Down
22 changes: 11 additions & 11 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: true # default
blank_issues_enabled: true # default
contact_links:
- name: '💬 pypa/virtualenv @ Discord'
url: https://discord.gg/pypa
about: Chat with the devs
- name: 🤷💻🤦 Discourse
url: https://discuss.python.org/c/packaging
about: |
Please ask typical Q&A here: general ideas for Python packaging, questions about structuring projects and so on
- name: 📝 PSF Code of Conduct
url: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
about: ❤ Be nice to other members of the community. ☮ Behave.
- name: "💬 pypa/virtualenv @ Discord"
url: https://discord.gg/pypa
about: Chat with the devs
- name: 🤷💻🤦 Discourse
url: https://discuss.python.org/c/packaging
about: |
Please ask typical Q&A here: general ideas for Python packaging, questions about structuring projects and so on
- name: 📝 PSF Code of Conduct
url: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
about: ❤ Be nice to other members of the community. ☮ Behave.
9 changes: 6 additions & 3 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
---
name: Feature request
about: Suggest an enhancement for this project
title: ''
title: ""
labels: enhancement
assignees: ''

assignees: ""
---

**What's the problem this feature will solve?**

<!-- What are you trying to do, that you are unable to achieve with virtualenv as it currently stands? -->

**Describe the solution you'd like**

<!-- Clear and concise description of what you want to happen. -->

<!-- Provide examples of real world use cases that this would enable and how it solves the problem described above. -->

**Alternative Solutions**

<!-- Have you tried to workaround the problem using virtualenv or other tools? Or a different approach to solving this issue? Please elaborate here. -->

**Additional context**

<!-- Add any other context, links, etc. about the feature here. -->
5 changes: 3 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
### Thanks for contributing, make sure you address all the checklists (for details on how see

[development documentation](https://virtualenv.pypa.io/en/latest/development.html#development))!

- [ ] ran the linter to address style issues (``tox -e fix_lint``)
- [ ] ran the linter to address style issues (`tox -e fix_lint`)
- [ ] wrote descriptive pull request text
- [ ] ensured there are test(s) validating the fix
- [ ] added news fragment in ``docs/changelog`` folder
- [ ] added news fragment in `docs/changelog` folder
- [ ] updated/extended the documentation
8 changes: 4 additions & 4 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Supported Versions

| Version | Supported |
| ----------- | ------------------ |
| 20.15.1 + | :white_check_mark: |
| < 20.15.1 | :x: |
| Version | Supported |
| --------- | ------------------ |
| 20.15.1 + | :white_check_mark: |
| < 20.15.1 | :x: |

## Reporting a Vulnerability

Expand Down
62 changes: 32 additions & 30 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ jobs:
- pypy-3.8-v7.3.7
os:
- ubuntu-20.04
- macos-10.15
- macos-12
- windows-2022
include:
- { os: macos-10.15, py: brew@py3 }
- { os: macos-12, py: "[email protected]" }
- { os: macos-12, py: "[email protected]" }
- { os: macos-12, py: "[email protected]" }
steps:
- name: Install OS dependencies
run: |
Expand All @@ -43,7 +45,7 @@ jobs:
${{ runner.os == 'Linux' && 'tar -zxf nushell.tar.gz' || true }} && \
${{ runner.os == 'Linux' && 'sudo cp nu /usr/bin' || true }} && \
${{ runner.os == 'Windows' && 'choco install nushell' || true }} && \
${{ runner.os == 'macOS' && 'brew update && brew install fish tcsh nushell' || true }} && \
${{ runner.os == 'macOS' && 'brew install fish tcsh nushell' || true }} && \
exit 0 || true;
done
exit 1
Expand All @@ -52,40 +54,38 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use local virtualenv for tox
run: python -m pip install .
- name: Install Python 2 for cross test
uses: actions/setup-python@v4
with:
python-version: "2.7"
- name: Setup brew python for test ${{ matrix.py }}
if: startsWith(matrix.py,'brew@')
run: |
set -e
PY=$(echo '${{ matrix.py }}' | cut -c 6-)
brew upgrade python@$PY || brew install python@$PY
echo "/usr/local/opt/python@$PY/libexec/bin" >>"${GITHUB_PATH}"
shell: bash
- name: Setup python for test ${{ matrix.py }}
if: "!( startsWith(matrix.py,'brew@py') || endsWith(matrix.py, '-dev') )"
if: "!( startsWith(matrix.py,'brew@') || endsWith(matrix.py, '-dev') )"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
- name: Setup brew python for test ${{ matrix.py }}
if: startsWith(matrix.py,'brew@py')
run: |
import subprocess; import codecs; import os
subprocess.check_call(["bash", "-c", "brew upgrade python@3 || brew install python@3"])
with codecs.open(os.environ["GITHUB_PATH"], "a", "utf-8") as file_handler:
file_handler.write("/usr/local/opt/python@3/bin")
shell: python
- name: Pick environment to run
run: |
import platform; import os; import sys; import codecs
cpy = platform.python_implementation() == "CPython"
base =("{}{}{}" if cpy else "{}{}").format("py" if cpy else "pypy", *sys.version_info[0:2])
env = "TOXENV={}\n".format(base)
print("Picked:\n{}for{}".format(env, sys.version))
with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler:
file_handler.write(env)
import os; import platform; import sys; from pathlib import Path
env = f'TOXENV=py{"" if platform.python_implementation() == "CPython" else "py"}3{sys.version_info.minor}'
print(f"Picked: {env} for {sys.version} based of {sys.executable}")
with Path(os.environ["GITHUB_ENV"]).open("ta") as file_handler:
file_handler.write(env)
shell: python
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install tox
run: python -m pip install tox
- name: Use local virtualenv for tox
run: python -m pip install .
- name: Setup test suite
run: tox -vv --notest
- name: Run test suite
Expand All @@ -95,7 +95,9 @@ jobs:
CI_RUN: "yes"
DIFF_AGAINST: HEAD
- name: Rename coverage report file
run: import os; import sys; os.rename(".tox/.coverage.{}".format(os.environ['TOXENV']), ".tox/.coverage.{}-{}".format(os.environ['TOXENV'], sys.platform))
run: |
import os; import sys
os.rename(f".tox/.coverage.{os.environ['TOXENV']}", f".tox/.coverage.{os.environ['TOXENV']}-{sys.platform}")
shell: python
- name: Upload coverage data
uses: actions/upload-artifact@v3
Expand All @@ -105,7 +107,7 @@ jobs:

coverage:
name: Combine coverage
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: test
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -142,7 +144,7 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- windows-2022
tox_env:
- dev
Expand Down Expand Up @@ -171,7 +173,7 @@ jobs:
publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [check, coverage]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Setup python to build package
uses: actions/setup-python@v4
Expand Down

0 comments on commit b795b97

Please sign in to comment.