Skip to content
Merged
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
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Python lint

on:
push:
pull_request:
schedule:
- cron: '3 19 * * SUN'

jobs:
build:

name: Python linting
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade pylint black mypy voluptuous-stubs

- name: Install
run: python setup.py install

- name: Run mypy
run: mypy geoip2 tests

- name: Run Pylint
run: pylint geoip2

- name: Run Black
run: black --check --diff .
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Python tests

on:
push:
pull_request:
schedule:
- cron: '3 15 * * SUN'

jobs:
build:

strategy:
matrix:
# We don't test on Windows currently as it appears mocket may not
# work there.
platform: [ubuntu-latest, macos-latest]
python-version: [3.6, 3.7, 3.8, 3.9]

name: Python ${{ matrix.python-version }} on ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}

steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true

- 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
pip install tox tox-gh-actions

- name: Test with tox
run: tox
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ pylint.txt
.pyre
.pytype
*.swp
.tox
violations.pyflakes.txt
16 changes: 0 additions & 16 deletions .travis-black.sh

This file was deleted.

6 changes: 0 additions & 6 deletions .travis-pylint.sh

This file was deleted.

54 changes: 0 additions & 54 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion dev-bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ hub release create -m "$message" "$tag"
git push --tags

rm -fr dist
python setup.py sdist bdist_wheel
python setup.py build_html sdist bdist_wheel
twine upload dist/*
17 changes: 16 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
[aliases]
build_html = build_sphinx -b html --build-dir docs
sdist = build_html sdist

[flake8]
# black uses 88 : ¯\_(ツ)_/¯
max-line-length = 88

[wheel]
universal = 1

[tox:tox]
envlist = py36, py37, py38, mypy

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39, mypy

[testenv]
deps =
pytest
mocket
commands = pytest tests