Skip to content

Commit

Permalink
Merge pull request #358 from cleder/develop
Browse files Browse the repository at this point in the history
1.0.alpha 13
  • Loading branch information
cleder authored Oct 4, 2024
2 parents 20e5e8f + 3ecc272 commit 3558f3e
Show file tree
Hide file tree
Showing 38 changed files with 5,139 additions and 574 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.8', '3.9', '3.10', '3.11', '3.12', '3.13-dev']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13-dev', '3.14-dev']

steps:
- uses: actions/checkout@v4
Expand All @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
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', '3.13-dev']

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -87,10 +87,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -e ".[typing, complexity, linting]"
pip install -e ".[typing, complexity, linting, tests]"
- name: Typecheck
run: |
mypy fastkml
mypy fastkml tests
- name: Linting
run: |
flake8 fastkml examples docs
Expand Down
20 changes: 12 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
hooks:
- id: pyprojectsort
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.18
rev: v0.20.2
hooks:
- id: validate-pyproject
- repo: https://github.com/ikamensh/flynt/
Expand All @@ -37,24 +37,24 @@ repos:
hooks:
- id: absolufy-imports
- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
rev: v3.17.0
hooks:
- id: pyupgrade
args: ["--py3-plus", "--py37-plus"]
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.4.9'
rev: 'v0.6.8'
hooks:
- id: ruff
- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
rev: 7.1.1
hooks:
- id: flake8
- repo: https://github.com/pre-commit/pygrep-hooks
Expand All @@ -70,18 +70,22 @@ repos:
- id: rst-inline-touching-normal
- id: text-unicode-replacement-char
- repo: https://github.com/rstcheck/rstcheck
rev: "v6.2.0"
rev: "v6.2.4"
hooks:
- id: rstcheck
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
rev: v1.11.2
hooks:
- id: mypy
additional_dependencies: [pygeoif>=1.4, arrow, pytest]
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
rev: "1.18.0"
hooks:
- id: blacken-docs
- repo: https://github.com/crate-ci/typos
rev: v1.25.0
hooks:
- id: typos
# - repo: https://github.com/Lucas-C/pre-commit-hooks-markup
# rev: v1.0.1
# hooks:
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ Optional
Limitations
===========

*Tesselate*, *Extrude* and *Altitude Mode* are assigned to a Geometry or
*Tessellate*, *Extrude* and *Altitude Mode* are assigned to a Geometry or
Geometry collection (MultiGeometry). You cannot assign different values of
*Tesselate*, *Extrude* or *Altitude Mode* on parts of a MultiGeometry.
*Tessellate*, *Extrude* or *Altitude Mode* on parts of a MultiGeometry.

Currently, the only major feature missing for the full Google Earth experience
is the `gx extension
Expand Down
6 changes: 6 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[default.extend-words]
lod = "lod"
Lod = "Lod"

[files]
extend-exclude = ["tests/ogc_conformance/data/kml/*.kml"]
2 changes: 1 addition & 1 deletion docs/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Changelog
-----------------

- specify minor python versions tested with Travis CI
- add support for tesselation, altitudeMode and extrude to Geometries
- add support for tessellation, altitudeMode and extrude to Geometries
- move implementation of geometry from kml.Placemark to geometry.Geometry
- add support for heterogenous GeometryCollection
- python 3 compatible
Expand Down
92 changes: 43 additions & 49 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,76 +11,70 @@ especially in the following ways:
* Commenting on open issues and pull requests
* Suggesting new features

Setting Up Your Environment
---------------------------

Pull Requests
-------------
Fork the repository and clone your fork to your local machine:

Start by submitting a pull request on GitHub against the ``develop`` branch of the
repository. Your pull request should provide a good description of the change
you are making, and/or the bug that you are fixing.
.. code-block:: bash
git clone https://github.com/yourusername/fastkml.git
cd fastkml
git checkout develop
Running Tests Locally
---------------------
Next, set up a virtual environment. This helps to manage dependencies and avoid conflicts:

You can make use of tox_ >= 1.8 to test the entire matrix of options:
.. code-block:: bash
* with / without lxml
* py36,py37,py38,py39
python3 -m venv .venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
as well as pep8 style checking in a single call (this approximates what happens
when the package is run through Travis-CI)
Then, install the required packages:

.. code-block:: python
.. code-block:: bash
# Install tox
pip install tox>=1.8
pip install -e ".[dev]"
# Run tox
tox
Install the ``pre-commit`` hook with:

# Or optionally
# (to skip tests for Python versions you do not have installed)
tox --skip-missing-interpreters
.. code-block:: bash
This will run through all of the tests and produce an output similar to::
pre-commit install
______________________________________________________ summary ______________________________________________________
SKIPPED: py36: InterpreterNotFound: python3.6
py37: commands succeeded
py38: commands succeeded
py39: commands succeeded
SKIPPED: py36-lxml: InterpreterNotFound: python3.6
py37-lxml: commands succeeded
py38-lxml: commands succeeded
py39-lxml: commands succeeded
pep8: commands succeeded
docs: commands succeeded
congratulations :)
and check the code with:

You are primarily looking for the ``congratulations :)`` line at the bottom,
signifying that the code is working as expected on all configurations
available.
.. code-block:: bash
.. _tox: https://pypi.python.org/pypi/tox
pre-commit run --all-files
coverage
~~~~~~~~
Running the Tests
-----------------

You can also run the tests with coverage_ to see which lines are covered by the
tests. This is useful for writing new tests to cover any uncovered lines::
To run the tests, simply use:

pytest tests --cov=fastkml --cov=tests --cov-report=xml
.. code-block:: bash
pytest
pre-commit
~~~~~~~~~~~
You can also run the tests with `coverage <https://coverage.readthedocs.io/>`_
to see which lines are covered by the tests.
This is useful for writing new tests to cover any uncovered lines:

Install the ``pre-commit`` hook with::
.. code-block:: bash
pip install pre-commit
pre-commit install
pytest --cov=fastkml --cov-report=term
and check the code with::
To get a report on the individual lines that are not covered, use the
``--cov-report=term-missing`` option, or generate an HTML report with
``--cov-report=html``.
Some editor extensions can also show the coverage directly in the editor, notably
`coverage-gutter <https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters>`_
for VSCode, which needs the output to be in the ``xml`` format produced with
``--cov-report=xml``.

pre-commit run --all-files

Tips
----

- Commit often, commit early.
- Make a draft PR while you are still working on it to give your work some visibility.
2 changes: 1 addition & 1 deletion fastkml/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
The only purpose of this module is to provide a version number for the package.
"""
__version__ = "1.0.a12"
__version__ = "1.0.a13"
Loading

0 comments on commit 3558f3e

Please sign in to comment.