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

add tox and switch to GithubAction #97

Closed
wants to merge 3 commits into from
Closed
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
35 changes: 0 additions & 35 deletions .circleci/config.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI

# On every pull request, but only on push to master
on:
push:
branches:
- master
tags:
- '*'
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v2

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox codecov pre-commit

# Run tox using the version of Python in `PATH`
- name: Run Tox
run: tox -e py

- name: Upload Results
if: success()
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: ${{ matrix.platform }}-${{ matrix.tox-env }}
fail_ci_if_error: false

# publish:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TDB

# needs: [tests]
# runs-on: ubuntu-latest
# if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v1
# with:
# python-version: "3.x"

# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# python -m pip install tox

# - name: Set tag version
# id: tag
# # https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
# run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}

# - name: Set module version
# id: module
# # https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
# run: echo ::set-output name=version::$(python setup.py --version)

# - name: Build and publish
# if: steps.tag.outputs.tag == steps.module.outputs.version
# env:
# TOXENV: release
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: tox
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
"pytest-asyncio<0.11.0",
"pytest-cov",
"shapely",
"botocore==1.15.32",
"boto3==1.12.32",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aioboto3, depends on aiobotocore which depends on specific boto3 and botocore versions. It's easier to let hem decide the version they need ;-)

"aioboto3",
]
}
Expand Down Expand Up @@ -62,4 +60,4 @@
entry_points={"console_scripts": ["aiocogeo=aiocogeo.scripts.cli:app"]},
extras_require=extras,
tests_require=extras['dev']
)
)
32 changes: 32 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[tox]
envlist = py37,py38

[testenv]
extras = dev
commands=
python -m pytest --cov aiocogeo --cov-report xml --cov-report term-missing
deps=
numpy

# Release tooling
[testenv:build]
basepython = python3
skip_install = true
deps =
wheel
setuptools
commands =
python setup.py sdist

[testenv:release]
setenv =
TWINE_USERNAME = {env:TWINE_USERNAME}
TWINE_PASSWORD = {env:TWINE_PASSWORD}
basepython = python3
skip_install = true
deps =
{[testenv:build]deps}
twine >= 1.5.0
commands =
{[testenv:build]commands}
twine upload --skip-existing dist/*