diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 2650f23..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,35 +0,0 @@ -# Python CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-python/ for more details -# -version: 2.1 -orbs: - codecov: codecov/codecov@1.0.5 -jobs: - build: - docker: - # specify the version you desire here - # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers` - - image: circleci/python:3.7 - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/postgres:9.4 - - working_directory: ~/repo - - steps: - - checkout - - # run tests! - # this example uses Django's built-in test-runner - # other common Python testing frameworks include pytest and nose - # https://pytest.org - # https://nose.readthedocs.io - - run: - name: run tests - command: pip install -e .[dev] && pytest -v - - - codecov/upload: - file: "coverage.xml" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c8a3ad7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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: + # 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 diff --git a/setup.py b/setup.py index a1e96ac..414f8bb 100644 --- a/setup.py +++ b/setup.py @@ -14,8 +14,6 @@ "pytest-asyncio<0.11.0", "pytest-cov", "shapely", - "botocore==1.15.32", - "boto3==1.12.32", "aioboto3", ] } @@ -62,4 +60,4 @@ entry_points={"console_scripts": ["aiocogeo=aiocogeo.scripts.cli:app"]}, extras_require=extras, tests_require=extras['dev'] -) \ No newline at end of file +) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..095c1df --- /dev/null +++ b/tox.ini @@ -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/*