Skip to content

Commit b86e9a8

Browse files
[repo-helper] Configuration Update (#38)
* Updated files with 'repo_helper'. * Updated files with 'repo_helper'. Co-authored-by: repo-helper[bot] <74742576+repo-helper[bot]@users.noreply.github.com>
1 parent 2afccf4 commit b86e9a8

File tree

6 files changed

+51
-13
lines changed

6 files changed

+51
-13
lines changed

.github/milestones.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env python
2+
3+
# stdlib
4+
import os
5+
import sys
6+
7+
# 3rd party
8+
from github3 import GitHub
9+
from github3.repos import Repository
10+
from packaging.version import InvalidVersion, Version
11+
12+
latest_tag = os.environ["GITHUB_REF_NAME"]
13+
14+
try:
15+
current_version = Version(latest_tag)
16+
except InvalidVersion:
17+
sys.exit()
18+
19+
gh: GitHub = GitHub(token=os.environ["GITHUB_TOKEN"])
20+
repo: Repository = gh.repository(*os.environ["GITHUB_REPOSITORY"].split('/', 1))
21+
22+
for milestone in repo.milestones(state="open"):
23+
try:
24+
milestone_version = Version(milestone.title)
25+
except InvalidVersion:
26+
continue
27+
if milestone_version == current_version:
28+
sys.exit(not milestone.update(state="closed"))

.github/workflows/python_ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313

1414
permissions:
1515
actions: write
16+
issues: write
1617
contents: read
1718

1819
jobs:
@@ -21,7 +22,7 @@ jobs:
2122
runs-on: "windows-2019"
2223
continue-on-error: ${{ matrix.config.experimental }}
2324
env:
24-
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.3,pypy-3.6,pypy-3.7,pypy-3.8'
25+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.5,pypy-3.6,pypy-3.7,pypy-3.8'
2526

2627
strategy:
2728
fail-fast: False
@@ -32,7 +33,7 @@ jobs:
3233
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
3334
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
3435
- {python-version: "3.10", testenvs: "py310,build", experimental: False}
35-
- {python-version: "3.11.0-alpha.3", testenvs: "py311-dev,build", experimental: True}
36+
- {python-version: "3.11.0-alpha.5", testenvs: "py311-dev,build", experimental: True}
3637
- {python-version: "pypy-3.6", testenvs: "pypy36,build", experimental: False}
3738
- {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: True}
3839
- {python-version: "pypy-3.8", testenvs: "pypy38,build", experimental: True}

.github/workflows/python_ci_linux.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414

1515
permissions:
1616
actions: write
17+
issues: write
1718
contents: read
1819

1920
jobs:
@@ -22,7 +23,7 @@ jobs:
2223
runs-on: "ubuntu-20.04"
2324
continue-on-error: ${{ matrix.config.experimental }}
2425
env:
25-
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.3,pypy-3.6,pypy-3.7,pypy-3.8'
26+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.5,pypy-3.6,pypy-3.7,pypy-3.8'
2627

2728
strategy:
2829
fail-fast: False
@@ -33,7 +34,7 @@ jobs:
3334
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
3435
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
3536
- {python-version: "3.10", testenvs: "py310,build", experimental: False}
36-
- {python-version: "3.11.0-alpha.3", testenvs: "py311-dev,build", experimental: True}
37+
- {python-version: "3.11.0-alpha.5", testenvs: "py311-dev,build", experimental: True}
3738
- {python-version: "pypy-3.6", testenvs: "pypy36,build", experimental: False}
3839
- {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: True}
3940
- {python-version: "pypy-3.8", testenvs: "pypy38,build", experimental: True}
@@ -139,21 +140,21 @@ jobs:
139140

140141
- name: Setup Python 🐍
141142
uses: "actions/setup-python@v2"
143+
if: startsWith(github.ref, 'refs/tags/')
142144
with:
143145
python-version: 3.8
144-
if: startsWith(github.ref, 'refs/tags/')
145146

146147
- name: Install dependencies 🔧
148+
if: startsWith(github.ref, 'refs/tags/')
147149
run: |
148150
python -m pip install --upgrade pip setuptools wheel
149151
python -m pip install --upgrade tox
150-
if: startsWith(github.ref, 'refs/tags/')
151152
152153
- name: Build distributions 📦
154+
if: startsWith(github.ref, 'refs/tags/')
153155
run: |
154156
tox -e build
155157
156-
if: startsWith(github.ref, 'refs/tags/')
157158
158159
- name: Upload distribution to PyPI 🚀
159160
if: startsWith(github.ref, 'refs/tags/')
@@ -162,3 +163,11 @@ jobs:
162163
user: __token__
163164
password: ${{ secrets.PYPI_TOKEN }}
164165
skip_existing: true
166+
167+
- name: Close milestone 🚪
168+
if: startsWith(github.ref, 'refs/tags/')
169+
run: |
170+
python -m pip install --upgrade github3.py packaging
171+
python milestones.py
172+
env:
173+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/python_ci_macos.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313

1414
permissions:
1515
actions: write
16+
issues: write
1617
contents: read
1718

1819
jobs:
@@ -21,7 +22,7 @@ jobs:
2122
runs-on: "macos-latest"
2223
continue-on-error: ${{ matrix.config.experimental }}
2324
env:
24-
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.3,pypy-3.7,pypy-3.8'
25+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.5,pypy-3.7,pypy-3.8'
2526

2627
strategy:
2728
fail-fast: False
@@ -32,7 +33,7 @@ jobs:
3233
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
3334
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
3435
- {python-version: "3.10", testenvs: "py310,build", experimental: False}
35-
- {python-version: "3.11.0-alpha.3", testenvs: "py311-dev,build", experimental: True}
36+
- {python-version: "3.11.0-alpha.5", testenvs: "py311-dev,build", experimental: True}
3637
- {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: True}
3738
- {python-version: "pypy-3.8", testenvs: "pypy38,build", experimental: True}
3839

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ repos:
4040
- id: bind-requirements
4141

4242
- repo: https://github.com/domdfcoding/flake8-dunder-all
43-
rev: v0.1.7
43+
rev: v0.1.8
4444
hooks:
4545
- id: ensure-dunder-all
4646
files: ^flake8_github_actions/.*\.py$
@@ -67,7 +67,7 @@ repos:
6767
- --keep-runtime-typing
6868

6969
- repo: https://github.com/Lucas-C/pre-commit-hooks
70-
rev: v1.1.10
70+
rev: v1.1.11
7171
hooks:
7272
- id: remove-crlf
7373
- id: forbid-crlf

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ envlist =
3030
skip_missing_interpreters = True
3131
isolated_build = True
3232
requires =
33-
pip>=20.3.3
33+
pip>=21
3434
tox-envlist>=0.2.1
35-
tox-pip-version>=0.0.7
3635

3736
[envlists]
3837
test = py36, py37, py38, py39, py310, py311-dev, pypy36, pypy37, pypy38

0 commit comments

Comments
 (0)