Skip to content

Commit f9faae4

Browse files
authored
Develop (#72)
* Using testing environment * Some changes to publish workflow * Fixed checking code style workflow * Added checkout to Code Style check * Formated setup.py * Added folders to checking code style * Updated actions
1 parent 4570ec7 commit f9faae4

File tree

6 files changed

+44
-53
lines changed

6 files changed

+44
-53
lines changed

.github/workflows/codeql-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
language: ["python"]
2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v2.3.4
2626
- name: Initialize CodeQL
2727
uses: github/codeql-action/init@v1
2828
with:

.github/workflows/codestyle.yml

+6-18
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,12 @@ on:
1111
- develop
1212

1313
jobs:
14-
build:
14+
check:
1515
runs-on: ubuntu-latest
16+
name: Check code style
1617
steps:
17-
- uses: actions/checkout@v2
18-
- name: Set up Python
19-
uses: actions/setup-python@v2
18+
- uses: actions/[email protected]
19+
- uses: RojerGS/python-black-check@master
2020
with:
21-
python-version: "3.9"
22-
- name: Cache pip
23-
uses: actions/[email protected]
24-
with:
25-
path: ~/.cache/pip
26-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
pip install -r requirements.txt
31-
- name: Lint with black
32-
run: |
33-
pip install black
34-
black .
21+
line-length: "88"
22+
path: ". tests codeforces_api"

.github/workflows/publish.yml

+16-13
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,20 @@ on:
1414

1515
jobs:
1616
test:
17+
environment:
18+
name: Testing
1719
runs-on: ubuntu-latest
1820
strategy:
1921
matrix:
2022
python-version: [3.6, 3.7, 3.8, 3.9]
2123
steps:
22-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v2.3.4
2325
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v2
26+
uses: actions/setup-python@v2.2.2
2527
with:
2628
python-version: ${{ matrix.python-version }}
2729
- name: Cache pip
28-
uses: actions/[email protected].4
30+
uses: actions/[email protected].6
2931
with:
3032
path: ~/.cache/pip
3133
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
@@ -36,33 +38,34 @@ jobs:
3638
pip install .
3739
- name: Test with pytest
3840
run: |
39-
pytest tests/test_api.py --api_key ${{ secrets.codeforces_api_key }} --api_secret ${{ secrets.codeforces_api_secret }}
41+
pytest tests/test_api.py --api_key ${{ secrets.CODEFORCES_API_KEY }} --api_secret ${{ secrets.CODEFORCES_API_SECRET }} -v
4042
publish:
4143
if: startsWith(github.ref, 'refs/tags/')
4244
needs: test
4345
name: Build and publish Python 🐍 distributions 📦 to PyPI
4446
runs-on: ubuntu-latest
4547
steps:
46-
- uses: actions/checkout@master
48+
- uses: actions/checkout@v2.3.4
4749
- name: Set up Python 3.9
48-
uses: actions/setup-python@v1
50+
uses: actions/setup-python@v2.2.2
4951
with:
5052
python-version: 3.9
5153
- name: Cache pip
52-
uses: actions/[email protected].4
54+
uses: actions/[email protected].6
5355
with:
5456
path: ~/.cache/pip
5557
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
5658
restore-keys: |
5759
${{ runner.os }}-pip-
58-
- name: Install twine
59-
run: >-
60+
- name: Install requirements
61+
run: |
62+
python -m pip install pip wheel twine --upgrade
6063
pip install -r requirements.txt
6164
- name: Build a binary wheel and a source tarball
62-
run: >-
65+
run: |
6366
python setup.py sdist
6467
- name: Publish distribution 📦 to PyPI
65-
uses: pypa/gh-action-pypi-publish@master
68+
uses: pypa/gh-action-pypi-publish@v1.4.2
6669
with:
6770
password: ${{ secrets.pypi_password }}
6871
release:
@@ -72,10 +75,10 @@ jobs:
7275
runs-on: ubuntu-latest
7376
steps:
7477
- name: Checkout code
75-
uses: actions/checkout@v2
78+
uses: actions/checkout@v2.3.4
7679
- name: Create Release
7780
id: create_release
78-
uses: actions/create-release@v1
81+
uses: actions/create-release@v1.1.4
7982
env:
8083
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8184
with:

.github/workflows/wiki.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v2.3.4
1515
- name: Install Python 3.8
16-
uses: actions/setup-python@v1
16+
uses: actions/setup-python@v2.2.2
1717
with:
1818
python-version: 3.8
1919
- name: Install dependencies

requirements.txt

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
appdirs==1.4.4
2-
astroid==2.5.2
2+
astroid==2.5.7
33
atomicwrites==1.4.0
4-
attrs==20.3.0
5-
black==20.8b1
4+
attrs==21.2.0
5+
black==21.5b2
66
bleach==3.3.0
7-
certifi==2020.12.5
7+
certifi==2021.5.30
88
chardet==4.0.0
9-
click==7.1.2
9+
click==8.0.1
1010
colorama==0.4.4
11-
docutils==0.17
11+
docutils==0.17.1
1212
idna==2.10
13-
importlib-metadata==3.10.0
13+
importlib-metadata==4.5.0
1414
iniconfig==1.1.1
1515
isort==5.8.0
1616
keyring==23.0.1
@@ -23,22 +23,22 @@ pathspec==0.8.1
2323
pkginfo==1.7.0
2424
pluggy==0.13.1
2525
py==1.10.0
26-
Pygments==2.8.1
27-
pylint==2.7.4
26+
Pygments==2.9.0
27+
pylint==2.8.2
2828
pyparsing==2.4.7
29-
pytest==6.2.3
29+
pytest==6.2.4
3030
pywin32-ctypes==0.2.0
3131
readme-renderer==29.0
3232
regex==2021.4.4
3333
requests==2.25.1
3434
requests-toolbelt==0.9.1
35-
rfc3986==1.4.0
36-
six==1.15.0
35+
rfc3986==1.5.0
36+
six==1.16.0
3737
toml==0.10.2
38-
tqdm==4.60.0
38+
tqdm==4.61.0
3939
twine==3.4.1
40-
typed-ast==1.4.2
41-
typing-extensions==3.7.4.3
40+
typed-ast==1.4.3
41+
typing-extensions==3.10.0.0
4242
urllib3==1.26.5
4343
webencodings==0.5.1
4444
wrapt==1.12.1

setup.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
from setuptools import setup
77

8-
with open(
9-
"codeforces_api/version.py", "r", encoding="utf-8"
10-
) as f:
11-
version = re.search(r"^__version__\s*=\s*\"(.*)\".*$", f.read(), flags=re.MULTILINE).group(1)
8+
with open("codeforces_api/version.py", "r", encoding="utf-8") as f:
9+
version = re.search(
10+
r"^__version__\s*=\s*\"(.*)\".*$", f.read(), flags=re.MULTILINE
11+
).group(1)
1212

1313
setup(
1414
name="CodeforcesApiPy",

0 commit comments

Comments
 (0)