From 45fdbcd74bb0af7836baefae7df20f138d0d61e1 Mon Sep 17 00:00:00 2001 From: Paul Schweizer Date: Fri, 24 Nov 2023 14:30:59 +0100 Subject: [PATCH] Cleanup --- .github/workflows/publish.yml | 29 ++++++++++++++++++++++ .github/workflows/pylint.yml | 23 ++++++++++++++++++ .github/workflows/pytest.yml | 29 ++++++++++++++++++++++ .travis.yml | 45 ----------------------------------- noxfile.py | 16 ------------- 5 files changed, 81 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/pylint.yml create mode 100644 .github/workflows/pytest.yml delete mode 100644 .travis.yml delete mode 100644 noxfile.py diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..76bc2d3 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,29 @@ +name: Publish + +on: + release: + types: + - created + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Install Poetry + run: | + python -m pip install --upgrade poetry wheel + - name: Install dependencies + run: | + poetry install + - name: Publish + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }} + run: | + poetry config pypi-token.pypi $POETRY_PYPI_TOKEN_PYPI + poetry build + poetry publish diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 0000000..4db823c --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,23 @@ +name: Pylint + +on: [push] + +jobs: + pylint: + name: Pylint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Install Poetry + run: | + python -m pip install --upgrade poetry wheel + - name: Install dependencies + run: | + poetry install + - name: Analysing the code with pylint + run: | + poetry run pylint ./ascii-canvas diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..611993e --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,29 @@ +# .github/workflows/app.yaml +name: Pytest + +on: [push] + +jobs: + tests: + name: Tests + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.10", "3.x"] + steps: + - name: Check out repository code + uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install Poetry + run: | + python -m pip install --upgrade poetry wheel + - name: Install dependencies + run: | + poetry install + - name: Run tests without coverage + if: ${{ matrix.python-version == 2.7 }} + run: | + poetry run pytest tests diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b6deca0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,45 +0,0 @@ -language: python -python: - - '2.7' - - '3.4' - - '3.5' - - '3.6' - -install: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - - python setup.py install - - if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then - pip install mypy; - fi; - -jobs: - include: - - stage: test - name: satic_type - script: nox -s static_type - if: env(TRAVIS_PYTHON_VERSION) = "3.6" - -script: - - coverage run --source ascii_canvas -m pytest ./tests --cov=ascii_canvas --cov-report=xml --cov-report=term - -after_success: - - if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then - python-codacy-coverage -r coverage.xml; - fi; - -before_deploy: - - python strip-type-hints.py; - -deploy: - provider: pypi - skip_existing: true - distributions: sdist bdist_wheel - user: Anton-4 - password: - secure: ZIeVakvSeDwoQhiGyMPx1CJGhk/RoOrAkopysX3v3bDTnsDmEynsmXkkfd4GpJif+w0jZNWIqwwCE5ycioeReNtNhe18Ii9vzpxAIOeTNnfXqld16Zi9QH6nydWISb+LjAV23xafi35Rp6ahteSE7LqYu9b6yEaxdjZOsUTukVMni/Kpy4SDGyk7vL/jnIxzLVJfBW6DVJCGeGEno1ioqgkvBzoCl1W+xNKgE8g1Bqnmup/8Q0MyqG5rr+Gs1UkPVt9G+1xiTbp3KKUiz1XtIIeJKiXwBvutqWBP0qESeIFfrEE5Xx08oW+QW6wpEDKiuLrZpUClwrzCQa2Ru6RcZB1Sua+6t+DIjl40E2MZTC/USBd29iN3akp4vC1GSjne/leHCcwwitev2O4tvmhNfh0gMXjHWSR8b0A/AD3ySz95XsoMz6YY3c/zPWM5wclJexw0GU8LmUg5MOr+oD93rDyEL/htNVq0xUlrQELAexj4Y6vI8p/yFOej9gSJHMlfkXoOfpY/dzmH7uyWC5qfE1D2K0fc5qpx6zyzw6avDM9m1gdNihWXqxjYxeOmmuD1wQXRg6cNAPeSHLLriiurIpZ3mclRvW/FqDZOGFQCrMidOwJB0Atg1GfnP3qTOs33jYnxtzTVqaJmsukV6FqJa6WDiNGi5OJ9D4Xt5+M4ou0= - on: - tags: true - repo: PaulSchweizer/ascii-canvas - branch: master - python: '3.6' diff --git a/noxfile.py b/noxfile.py deleted file mode 100644 index 3099380..0000000 --- a/noxfile.py +++ /dev/null @@ -1,16 +0,0 @@ -import nox -import os - - -@nox.session(python=["3.6"]) -def static_type(session): - session.install("mypy") - - session.run("mypy", "--ignore-missing-imports", "ascii_canvas") - - -@nox.session(python=["2.7", "3.4", "3.5", "3.6"]) -def pytests_no_hints(session): - session.install("-r", "test-requirements.txt") - - session.run("python", "-m", "pytest", "--spec", "-s", os.path.join("tests"))