-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from pedrocamargo/master
- Loading branch information
Showing
12 changed files
with
97 additions
and
432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,69 @@ | ||
name: Tests | ||
|
||
on: [push] | ||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set Python environment | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
architecture: x64 | ||
|
||
- name: Install dependencies | ||
run: pip install -e .[dev] | ||
|
||
- name: Linting | ||
run: | | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Check code format with Black | ||
run: black --check us | ||
|
||
testing: | ||
needs: linting | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
max-parallel: 6 | ||
matrix: | ||
python-version: [3.8, 3.9, "3.10", 3.11, 3.12] | ||
|
||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install pipenv | ||
uses: dschep/install-pipenv-action@v1 | ||
- name: Install dependencies | ||
run: | | ||
pipenv install --dev --skip-lock --python `which python` | ||
- name: Linting and formatting | ||
if: ${{ matrix.python-version == '3.11' }} | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
pipenv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
pipenv run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
# check formatting | ||
pipenv run black --check us | ||
pip install -e .[dev] | ||
- name: Test with pytest | ||
run: | | ||
pipenv run pytest | ||
pytest . | ||
building: | ||
needs: linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set Python environment | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
architecture: x64 | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install setuptools build wheel | ||
- name: Builds package | ||
run: | | ||
python -m build . -w -n | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels | ||
path: ./dist/*.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
.env | ||
|
||
# Compilation and caching | ||
build/ | ||
dist/ | ||
.cache/ | ||
.mypy_cache/ | ||
.pytest_cache/ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
|
||
[project] | ||
name = "us" | ||
description = "US state meta information and other fun stuff" | ||
readme = "README.rst" | ||
urls.Homepage = "https://github.com/unitedstates/python-us/" | ||
urls."Issue tracker" = "https://github.com/unitedstates/python-us/issues" | ||
requires-python = ">=3.7" | ||
dynamic = ["version"] | ||
authors = [{ name = "Jeremy Carbaugh", email = "[email protected]" }] | ||
classifiers = [ | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12" | ||
] | ||
license = { file = "LICENSE"} | ||
|
||
dependencies = ['jellyfish'] | ||
|
||
[project.optional-dependencies] | ||
dev = ['flake8', 'black', 'pytest', 'pytz'] | ||
|
||
|
||
[tool.setuptools.dynamic] | ||
version = { attr = "us.version.__version__" } | ||
|
||
[tool.black] | ||
line-length = 120 | ||
target-version = ['py39', 'py310', 'py311', 'py312'] | ||
include = '\.pyi?$' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
OBSOLETE, # noqa | ||
) # noqa | ||
from .unitedstatesofamerica import * # noqa | ||
from .version import __version__ as version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "3.1.2" |