Skip to content

Commit

Permalink
removed tox + remake GH workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
elrandira committed May 1, 2023
1 parent bc68798 commit 644f55b
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 83 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Validation

on:
push:
branches:
- master
tags:
- v**

permissions:
contents: read

jobs:
release:

runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install -e .[dev]
- name: publish
run: invoke publish_test
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application
name: Validation

on: pull_request

permissions:
contents: read

jobs:
validate_unix:

runs-on: ubuntu-latest
validate:
strategy:
matrix:
python-version: ["3.8", "3.9"]
os:
- ubuntu-latest
- windows-latest
python-version:
- 3.8
- 3.9
- '3.10'
- '3.11'
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v3
Expand All @@ -28,7 +34,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install -r requirements-dev.txt
python -m pip install -e .[dev]
- name: check pylint
run: pylint JSONLibrary --disable=R,C,W0703,W0212,W1203
Expand All @@ -52,31 +58,3 @@ jobs:
coverage xml --rcfile tests/.coveragerc
coverage html --rcfile tests/.coveragerc
robot -d tests/__out__/robot acceptance/
validate_windows:

runs-on: windows-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- name: checkout
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install -r requirements-dev.txt
- name: validate
run: |
pytest --cov-config=tests/.coveragerc --cov --cov-report term tests/
coverage xml --rcfile tests/.coveragerc
coverage html --rcfile tests/.coveragerc
robot -d tests/__out__/robot acceptance/
3 changes: 1 addition & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
twine
wheel
pylint
invoke
black
tox
pytest
pytest-cov
coverage
flake8
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
with open(os.path.join(HERE, "JSONLibrary", "__version__.py"), encoding="utf8") as f:
exec(f.read(), version)

requirements = [
i.strip() for i in open("requirements.txt", encoding="utf8").readlines()
]

def readfile(_file):
with open(_file, encoding="utf8") as fh:
return [i.strip() for i in fh.readlines()]


setup(
name="robotframework-jsonlibrary",
Expand All @@ -21,7 +23,8 @@
url="https://github.com/nottyo/robotframework-jsonlibrary.git",
packages=["JSONLibrary"],
package_dir={"robotframework-jsonlibrary": "JSONLibrary"},
install_requires=requirements,
install_requires=readfile("requirements.txt"),
extras_require={"dev": readfile("requirements-dev.txt")},
include_package_data=True,
keywords="testing robotframework json jsonschema jsonpath",
classifiers=[
Expand Down
31 changes: 4 additions & 27 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def clean(_):
os.path.join("tests", "__out__"),
ignore_errors=True,
)
shutil.rmtree(".tox", ignore_errors=True)
shutil.rmtree(".pytest_cache", ignore_errors=True)
shutil.rmtree("build", ignore_errors=True)
shutil.rmtree("dist", ignore_errors=True)
Expand Down Expand Up @@ -47,33 +46,11 @@ def install(ctx):
ctx.run(f"{sys.executable} -m pip install {wheel_file}", hide="both")


@task(install)
def test(ctx):
ctx.run("tox")


@task
def style_check(ctx):
ctx.run("black . --check --diff")


@task
def reformat_code(ctx):
ctx.run("black .")


@task
@task(build)
def publish(ctx):
ctx.run(f"{sys.executable} -m twine upload dist/*")


@task
def docs(ctx):
ctx.run(f"{sys.executable} -m robot.libdoc JSONLibrary docs/JSONLibrary.html")


@task(install)
def lint(ctx):
ctx.run("pylint JSONLibrary --disable=R,C,W0703,W0212,W1203")
uninstall(ctx)
clean(ctx)
@task(build)
def publish_test(ctx):
ctx.run(f"{sys.executable} -m twine upload --repository testpypi dist/*")
16 changes: 0 additions & 16 deletions tox.ini

This file was deleted.

0 comments on commit 644f55b

Please sign in to comment.