Skip to content

Commit

Permalink
fix github action, fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
cleder committed Oct 30, 2023
1 parent e6406aa commit 0b40936
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/run-all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '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
Expand All @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '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
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r test-requirements.txt
pip install -e ".[typing, complexity, linting]"
- name: Typecheck
run: |
mypy fastkml
Expand All @@ -87,7 +87,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
pypy-version: ['pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10']
pypy-version: ['pypy-3.8', 'pypy-3.9', 'pypy-3.10']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.pypy-version }}
Expand Down
3 changes: 0 additions & 3 deletions fastkml/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
__all__ = [
"ATOMNS",
"DEFAULT_NAME_SPACES",
"FORCE3D",
"GXNS",
"KMLNS",
"register_namespaces",
Expand Down Expand Up @@ -76,5 +75,3 @@ def set_default_namespaces() -> None:


set_default_namespaces()

FORCE3D = False
20 changes: 20 additions & 0 deletions fastkml/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@
from fastkml.enums import Verbosity
from fastkml.types import Element

__all__ = [
"Data",
"ExtendedData",
"Schema",
"SchemaData",
"SchemaDataDictInput",
"SchemaDataInput",
"SchemaDataListInput",
"SchemaDataOutput",
"SchemaDataTupleInput",
"SchemaDataType",
"SimpleField",
"SimpleFields",
"SimpleFieldsDictInput",
"SimpleFieldsInput",
"SimpleFieldsListInput",
"SimpleFieldsOutput",
"SimpleFieldsTupleInput",
]

logger = logging.getLogger(__name__)


Expand Down
2 changes: 2 additions & 0 deletions fastkml/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from enum import Enum
from enum import unique

__all__ = ["AltitudeMode", "DateTimeResolution", "Verbosity"]


@unique
class Verbosity(Enum):
Expand Down
3 changes: 3 additions & 0 deletions fastkml/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ class KMLParseError(FastKMLError):

class KMLWriteError(FastKMLError):
"""Raised when there is an error writing KML."""


__all__ = ["FastKMLError", "KMLParseError", "KMLWriteError"]
12 changes: 12 additions & 0 deletions fastkml/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@
from fastkml.exceptions import KMLWriteError
from fastkml.types import Element

__all__ = [
"AnyGeometryType",
"GeometryType",
"LineString",
"LinearRing",
"MultiGeometry",
"MultiGeometryType",
"Point",
"Polygon",
"create_multigeometry",
]

logger = logging.getLogger(__name__)

GeometryType = Union[geo.Polygon, geo.LineString, geo.LinearRing, geo.Point]
Expand Down
11 changes: 11 additions & 0 deletions fastkml/gx.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,17 @@
from fastkml.geometry import _Geometry
from fastkml.types import Element

__all__ = [
"Angle",
"MultiTrack",
"Track",
"TrackItem",
"linestring_to_track_items",
"multilinestring_to_tracks",
"track_items_to_geometry",
"tracks_to_geometry",
]

logger = logging.getLogger(__name__)


Expand Down
8 changes: 8 additions & 0 deletions fastkml/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
from fastkml import config
from fastkml.types import Element

__all__ = [
"o_from_attr",
"o_from_subelement_text",
"o_int_from_attr",
"o_to_attr",
"o_to_subelement_text",
]

logger = logging.getLogger(__name__)


Expand Down
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,31 @@ complexity = [
]
dev = [
"fastkml[complexity]",
"fastkml[docs]",
"fastkml[tests]",
"fastkml[typing]",
"pre-commit",
]
docs = [
"Sphinx",
"sphinx-autodoc-typehints",
"sphinx-rtd-theme",
]
linting = [
"black",
"flake8",
"flake8-comments",
"flake8-continuation",
"flake8-encodings",
"flake8-expression-complexity",
"flake8-length",
"flake8-literal",
"flake8-pep3101",
"flake8-super",
"flake8-typing-imports",
"ruff",
"yamllint",
]
lxml = [
"lxml",
]
Expand Down
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-r requirements.txt
-r doc-requirements.txt
-r doc/requirements.txt
black
flake8
# flake8-dunder-all
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ deps =
commands =
make html
[flake8]
min_python_version = 3.6.10
min_python_version = 3.7
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist
max_line_length = 89
ignore=
Expand All @@ -35,3 +35,5 @@ per-file-ignores =
tests/*.py: E722,E741,E501,DALL
examples/*.py: DALL
enable-extensions=G
literal_inline_quotes = double
literal_multiline_quotes = double

0 comments on commit 0b40936

Please sign in to comment.