diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0df9b7e..d985987 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,18 +5,26 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.8', '3.9', '3.10', '3.11', ] + python-version: [ '3.10', '3.11', '3.12' ] name: Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v3 + - name: Set up Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: x64 + - name: Install - run: pip install . - - name: Test - run: python run_tests.py + run: pip install .[development] + - name: Lint + run: | + ruff format . --check + ruff check . + - name: Test + run: | + python run_tests.py + python tests/data_schemas.py diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e5f4b7f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -dist: xenial -language: python -python: - - '3.4' - - '3.5' - - '3.6' - - '3.7' - - '3.8' -matrix: - include: - - python: '3.8' - env: BLACK=1 -install: - - pip install --upgrade pip - - pip install -e .[testing] -script: - - coverage run --source=uk_election_ids ./run_tests.py - - sh -c "if [ '$BLACK' = '1' ]; then pip install black ; fi" - - sh -c "if [ '$BLACK' = '1' ]; then black --check . ; fi" -after_success: - - coveralls diff --git a/README.md b/README.md index dd5869a..0007245 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,10 @@ Create and validate Democracy Club Election Identifiers. --- -[![Build Status](https://travis-ci.org/DemocracyClub/uk-election-ids.svg?branch=master)](https://travis-ci.org/DemocracyClub/uk-election-ids) -[![Coverage Status](https://coveralls.io/repos/github/DemocracyClub/uk-election-ids/badge.svg?branch=master)](https://coveralls.io/github/DemocracyClub/uk-election-ids?branch=master) +[![Run tests](https://github.com/DemocracyClub/uk-election-ids/actions/workflows/test.yml/badge.svg)](https://github.com/DemocracyClub/uk-election-ids/actions/workflows/test.yml) ![PyPI Version](https://img.shields.io/pypi/v/uk-election-ids.svg) ![License](https://img.shields.io/pypi/l/uk-election-ids.svg) ![Python Support](https://img.shields.io/pypi/pyversions/uk-election-ids.svg) -![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg) * Installation: `pip install uk-election-ids` * [Documentation](https://democracyclub.github.io/uk-election-ids/) diff --git a/build.sh b/build.sh deleted file mode 100755 index b0a0417..0000000 --- a/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -e - -pip install "setuptools>=38.6.0" -pip install "twine>=1.11.0" -python setup.py sdist diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index 68b252b..0000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pre-commit==3.5.0 -ruff==0.3.7 diff --git a/setup.py b/setup.py index d4b6b84..76ce6b4 100644 --- a/setup.py +++ b/setup.py @@ -28,23 +28,24 @@ def _get_description(): long_description_content_type="text/markdown", extras_require={ "testing": ["coveralls"], + "docs": [ + "sphinx==7.1.2", + "sphinx_rtd_theme==2.0.0", + "ghp-import==2.1.0", + ], "development": [ - "sphinx", - "sphinx_rtd_theme", - "ghp-import", - "pydantic", - "black==23.3.0", - "ruff==0.0.261", + "pydantic==1.10.18", + "pre-commit==3.5.0", + "ruff==0.3.7", ], }, classifiers=[ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "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", ], project_urls={ "Documentation": "https://democracyclub.github.io/uk-election-ids/", diff --git a/tests/data_schemas.py b/tests/data_schemas.py index 709ed12..e62840e 100644 --- a/tests/data_schemas.py +++ b/tests/data_schemas.py @@ -39,12 +39,13 @@ def _recurse_defaults(d: dict): _recurse_defaults(values["defaults"]) return values - # import ipdb; ipdb.set_trace() - # return super().validate(value) - if __name__ == "__main__": - data = Path(__file__).parent / "voting_systems.json" + data = ( + Path(__file__).parent.parent + / "uk_election_ids" + / "data" + / "voting_systems.json" + ) schema = VotingSystemSchema.parse_file(data) VotingSystemSchema.validate(schema) - # print(schema) diff --git a/tests/test_slugger.py b/tests/test_slugger.py index 843ed9d..2ca7f30 100644 --- a/tests/test_slugger.py +++ b/tests/test_slugger.py @@ -6,7 +6,6 @@ class TestSlugify(TestCase): - """ For this particular use-case, we are primarily concerned with 1. Slugging characters that appear in names of places in the UK sensibly diff --git a/uk_election_ids/parser.py b/uk_election_ids/parser.py index 52ddb2d..95239a3 100644 --- a/uk_election_ids/parser.py +++ b/uk_election_ids/parser.py @@ -4,7 +4,6 @@ class DataPackageParser: - """ Parser which uses the data in datapackage.py to build a dict of IdSpec() objects which describe what sort of