Skip to content

Commit 644f55b

Browse files
committed
removed tox + remake GH workflows
1 parent bc68798 commit 644f55b

File tree

6 files changed

+60
-83
lines changed

6 files changed

+60
-83
lines changed

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Validation
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
tags:
11+
- v**
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
release:
18+
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Set up Python 3.9
25+
uses: actions/setup-python@v3
26+
with:
27+
python-version: 3.9
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
python -m pip install -e .
33+
python -m pip install -e .[dev]
34+
35+
- name: publish
36+
run: invoke publish_test
Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
33

4-
name: Python application
4+
name: Validation
55

66
on: pull_request
77

88
permissions:
99
contents: read
1010

1111
jobs:
12-
validate_unix:
13-
14-
runs-on: ubuntu-latest
12+
validate:
1513
strategy:
1614
matrix:
17-
python-version: ["3.8", "3.9"]
15+
os:
16+
- ubuntu-latest
17+
- windows-latest
18+
python-version:
19+
- 3.8
20+
- 3.9
21+
- '3.10'
22+
- '3.11'
23+
runs-on: ${{ matrix.os }}
1824
steps:
1925
- name: checkout
2026
uses: actions/checkout@v3
@@ -28,7 +34,7 @@ jobs:
2834
run: |
2935
python -m pip install --upgrade pip
3036
python -m pip install -e .
31-
python -m pip install -r requirements-dev.txt
37+
python -m pip install -e .[dev]
3238
3339
- name: check pylint
3440
run: pylint JSONLibrary --disable=R,C,W0703,W0212,W1203
@@ -52,31 +58,3 @@ jobs:
5258
coverage xml --rcfile tests/.coveragerc
5359
coverage html --rcfile tests/.coveragerc
5460
robot -d tests/__out__/robot acceptance/
55-
56-
validate_windows:
57-
58-
runs-on: windows-latest
59-
strategy:
60-
matrix:
61-
python-version: ["3.10", "3.11"]
62-
steps:
63-
- name: checkout
64-
uses: actions/checkout@v3
65-
66-
- name: Set up Python ${{ matrix.python-version }}
67-
uses: actions/setup-python@v3
68-
with:
69-
python-version: ${{ matrix.python-version }}
70-
71-
- name: Install dependencies
72-
run: |
73-
python -m pip install --upgrade pip
74-
python -m pip install -e .
75-
python -m pip install -r requirements-dev.txt
76-
77-
- name: validate
78-
run: |
79-
pytest --cov-config=tests/.coveragerc --cov --cov-report term tests/
80-
coverage xml --rcfile tests/.coveragerc
81-
coverage html --rcfile tests/.coveragerc
82-
robot -d tests/__out__/robot acceptance/

requirements-dev.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
twine
22
wheel
33
pylint
4-
invoke
54
black
6-
tox
75
pytest
86
pytest-cov
7+
coverage
98
flake8

setup.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
with open(os.path.join(HERE, "JSONLibrary", "__version__.py"), encoding="utf8") as f:
77
exec(f.read(), version)
88

9-
requirements = [
10-
i.strip() for i in open("requirements.txt", encoding="utf8").readlines()
11-
]
9+
10+
def readfile(_file):
11+
with open(_file, encoding="utf8") as fh:
12+
return [i.strip() for i in fh.readlines()]
13+
1214

1315
setup(
1416
name="robotframework-jsonlibrary",
@@ -21,7 +23,8 @@
2123
url="https://github.com/nottyo/robotframework-jsonlibrary.git",
2224
packages=["JSONLibrary"],
2325
package_dir={"robotframework-jsonlibrary": "JSONLibrary"},
24-
install_requires=requirements,
26+
install_requires=readfile("requirements.txt"),
27+
extras_require={"dev": readfile("requirements-dev.txt")},
2528
include_package_data=True,
2629
keywords="testing robotframework json jsonschema jsonpath",
2730
classifiers=[

tasks.py

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def clean(_):
1717
os.path.join("tests", "__out__"),
1818
ignore_errors=True,
1919
)
20-
shutil.rmtree(".tox", ignore_errors=True)
2120
shutil.rmtree(".pytest_cache", ignore_errors=True)
2221
shutil.rmtree("build", ignore_errors=True)
2322
shutil.rmtree("dist", ignore_errors=True)
@@ -47,33 +46,11 @@ def install(ctx):
4746
ctx.run(f"{sys.executable} -m pip install {wheel_file}", hide="both")
4847

4948

50-
@task(install)
51-
def test(ctx):
52-
ctx.run("tox")
53-
54-
55-
@task
56-
def style_check(ctx):
57-
ctx.run("black . --check --diff")
58-
59-
60-
@task
61-
def reformat_code(ctx):
62-
ctx.run("black .")
63-
64-
65-
@task
49+
@task(build)
6650
def publish(ctx):
6751
ctx.run(f"{sys.executable} -m twine upload dist/*")
6852

6953

70-
@task
71-
def docs(ctx):
72-
ctx.run(f"{sys.executable} -m robot.libdoc JSONLibrary docs/JSONLibrary.html")
73-
74-
75-
@task(install)
76-
def lint(ctx):
77-
ctx.run("pylint JSONLibrary --disable=R,C,W0703,W0212,W1203")
78-
uninstall(ctx)
79-
clean(ctx)
54+
@task(build)
55+
def publish_test(ctx):
56+
ctx.run(f"{sys.executable} -m twine upload --repository testpypi dist/*")

tox.ini

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

0 commit comments

Comments
 (0)