Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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: Release

on:
release:
types: [published]

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
37 changes: 37 additions & 0 deletions .github/workflows/release_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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: Release

on:
push:
tags:
- test**

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: build
run: python setup.py bdist_wheel

- name: publish
run: python -m twine upload --repository testpypi dist/*
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/
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
twine
wheel
pylint
invoke
black
tox
pytest
pytest-cov
coverage
flake8
invoke
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.