Skip to content

Commit 9b3d93a

Browse files
committed
Reworked a bunch
1 parent 952eab7 commit 9b3d93a

22 files changed

Lines changed: 1151 additions & 3273 deletions

.coveragerc

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Testing and distribution
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
lint-python:
9+
name: Lint Python code
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Install pipenv
16+
run: pipx install pipenv
17+
18+
- uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.9'
21+
cache: 'pipenv'
22+
23+
- id: pipenv-install
24+
name: Install Python dependencies
25+
run: pipenv install --dev --python `which python`
26+
27+
- id: lint
28+
name: Lint
29+
run: pipenv run flake8 ./censusbatchgeocoder
30+
31+
test-python:
32+
name: Test Python code
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v2
37+
38+
- name: Install pipenv
39+
run: pipx install pipenv
40+
41+
- uses: actions/setup-python@v2
42+
with:
43+
python-version: '3.9'
44+
cache: 'pipenv'
45+
46+
- id: pipenv-install
47+
name: Install Python dependencies
48+
run: pipenv install --dev --python `which python`
49+
50+
- id: run
51+
name: Run tests
52+
run: pipenv run python setup.py test
53+
shell: bash
54+
55+
test-build:
56+
name: Build Python package
57+
runs-on: ubuntu-latest
58+
needs: [test-python]
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v2
62+
63+
- name: Install pipenv
64+
run: pipx install pipenv
65+
66+
- uses: actions/setup-python@v2
67+
with:
68+
python-version: '3.9'
69+
cache: 'pipenv'
70+
71+
- id: pipenv-install
72+
name: Install Python dependencies
73+
run: pipenv install --dev --python `which python`
74+
75+
- id: build
76+
name: Build release
77+
run: |
78+
pipenv run python setup.py sdist
79+
pipenv run python setup.py bdist_wheel
80+
81+
- id: check
82+
name: Check release
83+
run: pipenv run twine check dist/*
84+
85+
- id: save
86+
name: Save artifact
87+
uses: actions/upload-artifact@v2
88+
with:
89+
name: test-release-${{ github.run_number }}
90+
path: ./dist
91+
if-no-files-found: error
92+
93+
tag-release:
94+
name: Tagged PyPI release
95+
runs-on: ubuntu-latest
96+
needs: [test-build]
97+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
98+
steps:
99+
- uses: actions/setup-python@v2
100+
with:
101+
python-version: '3.9'
102+
103+
- id: fetch
104+
name: Fetch artifact
105+
uses: actions/download-artifact@v2
106+
with:
107+
name: test-release-${{ github.run_number }}
108+
path: ./dist
109+
110+
- id: publish
111+
name: Publish release
112+
uses: pypa/gh-action-pypi-publish@release/v1
113+
with:
114+
user: __token__
115+
password: ${{ secrets.PYPI_API_TOKEN }}
116+
verbose: true
117+
verify_metadata: false

.pre-commit-config.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.1.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
args: ['--maxkb=10000']
12+
- id: check-case-conflict
13+
- id: check-json
14+
- id: mixed-line-ending
15+
16+
- repo: https://github.com/psf/black
17+
rev: 22.3.0
18+
hooks:
19+
- id: black
20+
21+
- repo: https://github.com/asottile/blacken-docs
22+
rev: v1.12.1
23+
hooks:
24+
- id: blacken-docs
25+
additional_dependencies: [black]
26+
27+
- repo: https://github.com/timothycrosley/isort
28+
rev: 5.10.1
29+
hooks:
30+
- id: isort
31+
args: ["--profile", "black", "--filter-files"]
32+
33+
- repo: https://gitlab.com/pycqa/flake8
34+
rev: 3.9.2
35+
hooks:
36+
- id: flake8
37+
38+
- repo: https://github.com/asottile/pyupgrade
39+
rev: v2.31.0
40+
hooks:
41+
- id: pyupgrade
42+
args: [--py37-plus]
43+
44+
- repo: https://github.com/pre-commit/mirrors-mypy
45+
rev: 'v0.931' # Use the sha / tag you want to point at
46+
hooks:
47+
- id: mypy
48+
additional_dependencies:
49+
- types-requests

.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
include LICENSE
22
include README.md
3-
recursive-include censusbatchgeocoder/tests *

Pipfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
agate = "*"
8+
requests = "*"
9+
six = "*"
10+
11+
[dev-packages]
12+
twine = "*"
13+
setuptools-scm = "*"
14+
flake8 = "*"
15+
sphinx = "*"
16+
pre-commit = "*"
17+
18+
[requires]
19+
python_version = "3.9"

0 commit comments

Comments
 (0)