10000 [repo-helper] Configuration Update (#13) · python-formate/snippet-fmt@033ac29 · GitHub
[go: up one dir, main page]

Skip to content

Commit 033ac29

Browse files
[repo-helper] Configuration Update (#13)
* 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 b00ea78 commit 033ac29

File tree

7 files changed

+50
-23
lines changed

7 files changed

+50
-23
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'
25+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.5'
2526

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

3738
steps:
3839
- name: Checkout 🛎️

.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'
26+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.5'
2627

2728
strategy:
2829
fail-fast: False
@@ -33,7 +34,7 @@ jobs:
3334
- {python-version: "3.8", testenvs: "py38-click{7,8},build", experimental: False}
3435
- {python-version: "3.9", testenvs: "py39-click{7,8},build", experimental: False}
3536
- {python-version: "3.10", testenvs: "py310-click{7,8},build", experimental: False}
36-
- {python-version: "3.11.0-alpha.3", testenvs: "py311-dev-click{7,8},build", experimental: True}
37+
- {python-version: "3.11.0-alpha.5", testenvs: "py311-dev-click{7,8},build", experimental: True}
3738

3839
steps:
3940
- name: Checkout 🛎️
@@ -136,21 +137,21 @@ jobs:
136137

137138
- name: Setup Python 🐍
138139
uses: "actions/setup-python@v2"
140+
if: startsWith(github.ref, 'refs/tags/')
139141
with:
140142
python-version: 3.8
141-
if: startsWith(github.ref, 'refs/tags/')
142143

143144
- name: Install dependencies 🔧
145+
if: startsWith(github.ref, 'refs/tags/')
144146
run: |
145147
python -m pip install --upgrade pip setuptools wheel
146148
python -m pip install --upgrade tox
147-
if: startsWith(github.ref, 'refs/tags/')
148149
149150
- name: Build distributions 📦
151+
if: startsWith(github.ref, 'refs/tags/')
150152
run: |
151153
tox -e build
152154
153-
if: startsWith(github.ref, 'refs/tags/')
154155
155156
- name: Upload distribution to PyPI 🚀
156157
if: startsWith(github.ref, 'refs/tags/')
@@ -159,3 +160,11 @@ jobs:
159160
user: __token__
160161
password: ${{ secrets.PYPI_TOKEN }}
161162
skip_existing: true
163+
164+
- name: Close milestone 🚪
165+
if: startsWith(github.ref, 'refs/tags/')
166+
run: |
167+
python -m pip install --upgrade github3.py packaging
168+
python .github/milestones.py
169+
env:
170+
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'
25+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.5'
2526

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

3738
steps:
3839
- name: Checkout 🛎️

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

setup.cfg

Lines changed: 0 additions & 10 deletions
This file was deleted.

tox.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ envlist =
2828
skip_missing_interpreters = True
2929
isolated_build = True
3030
requires =
31-
pip>=20.3.3
31+
pip>=21
3232
tox-envlist>=0.2.1
33-
tox-pip-version>=0.0.7
3433

3534
[envlists]
3635
test =
@@ -58,7 +57,6 @@ commands =
5857
[testenv:docs]
5958
setenv = SHOW_TODOS = 1
6059
basepython = python3.8
61-
pip_version = pip>=21
6260
changedir = {toxinidir}/doc-source
6361
deps = -r{toxinidir}/doc-source/requirements.txt
6462
commands = sphinx-build -M {env:SPHINX_BUILDER:html} . ./build {posargs}

0 commit comments

Comments
 (0)
0