Skip to content

Commit

Permalink
Merge pull request #151 from cleder/develop
Browse files Browse the repository at this point in the history
1.0.alpha.2
  • Loading branch information
cleder authored Oct 12, 2022
2 parents 5c7ffaa + 2a043bb commit b3a2107
Show file tree
Hide file tree
Showing 42 changed files with 5,206 additions and 2,052 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Set update schedule for GitHub Actions
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
...
81 changes: 81 additions & 0 deletions .github/workflows/codesee-arch-diagram.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
on:
push:
branches:
- main
pull_request_target:
types: [opened, synchronize, reopened]

name: CodeSee Map

jobs:
test_map_action:
runs-on: ubuntu-latest
continue-on-error: true
name: Run CodeSee Map Analysis
steps:
- name: checkout
id: checkout
uses: actions/[email protected]
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

# codesee-detect-languages has an output with id languages.
- name: Detect Languages
id: detect-languages
uses: Codesee-io/codesee-detect-languages-action@latest

- name: Configure JDK 16
uses: actions/setup-java@v3
if: ${{ fromJSON(steps.detect-languages.outputs.languages).java }}
with:
java-version: '16'
distribution: 'zulu'

# CodeSee Maps Go support uses a static binary so there's no setup step required.

- name: Configure Node.js 14
uses: actions/setup-node@v3
if: ${{ fromJSON(steps.detect-languages.outputs.languages).javascript }}
with:
node-version: '14'

- name: Configure Python 3.x
uses: actions/setup-python@v4
if: ${{ fromJSON(steps.detect-languages.outputs.languages).python }}
with:
python-version: '3.10'
architecture: 'x64'

- name: Configure Ruby '3.x'
uses: ruby/setup-ruby@v1
if: ${{ fromJSON(steps.detect-languages.outputs.languages).ruby }}
with:
ruby-version: '3.0'

# CodeSee Maps Rust support uses a static binary so there's no setup step required.

- name: Generate Map
id: generate-map
uses: Codesee-io/codesee-map-action@latest
with:
step: map
github_ref: ${{ github.ref }}
languages: ${{ steps.detect-languages.outputs.languages }}

- name: Upload Map
id: upload-map
uses: Codesee-io/codesee-map-action@latest
with:
step: mapUpload
api_token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
github_ref: ${{ github.ref }}

- name: Insights
id: insights
uses: Codesee-io/codesee-map-action@latest
with:
step: insights
api_token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
github_ref: ${{ github.ref }}
45 changes: 23 additions & 22 deletions .github/workflows/run-all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11-dev']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -23,31 +23,32 @@ jobs:
pip install -r test-requirements.txt
- name: Test with pytest
run: |
pytest fastkml --cov=fastkml --cov-fail-under=96 --cov-report=xml
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
pytest fastkml
cpython-lxml:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11-dev']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r test-requirements.txt
pip install lxml
- name: Test with pytest
run: |
python setup.py test
pytest fastkml --cov=fastkml --cov-fail-under=88 --cov-report=xml
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true

static-tests:
runs-on: ubuntu-latest
Expand All @@ -56,18 +57,18 @@ jobs:
python-version: ['3.9']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r test-requirements.txt
# - name: Typecheck
# run: |
# mypy fastkml
- name: Typecheck
run: |
mypy fastkml
- name: Linting
run: |
flake8 fastkml examples docs
Expand All @@ -83,11 +84,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
pypy-version: ['pypy-3.6', 'pypy-3.7']
pypy-version: ['pypy-3.7', 'pypy-3.8', 'pypy-3.9']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.pypy-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pypy-version }}
- name: Install dependencies
Expand All @@ -103,9 +104,9 @@ jobs:
name: Build and publish to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3.1.0
- name: Set up Python 3.9
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install pypa/build
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@ venv
# editors
.vscode/
.idea/

# typing
.mypy_cache/
.pyre/
.watchmanconfig

# misc
.dccache
2 changes: 2 additions & 0 deletions .pep8speaks.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
scanner:
linter: flake8

flake8:
max-line-length: 89
...
60 changes: 60 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: name-tests-test
exclude: ^fastkml/tests/base.py
- id: no-commit-to-branch
- id: pretty-format-json
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/ikamensh/flynt/
rev: "0.76"
hooks:
- id: flynt
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
- repo: https://github.com/hakancelikdev/unimport
rev: 0.12.1
hooks:
- id: unimport
args: [--remove, --include-star-import, --ignore-init, --gitignore]
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/mgedmin/check-manifest
rev: "0.48"
hooks:
- id: check-manifest
# - repo: https://github.com/Lucas-C/pre-commit-hooks-markup
# rev: v1.0.1
# hooks:
# - id: rst-linter
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.910
# hooks:
# - id: mypy
...
10 changes: 6 additions & 4 deletions .pyup.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# configure updates globally
# default: all
# allowed: all, insecure, False
Expand All @@ -6,7 +7,7 @@ update: all
# configure dependency pinning globally
# default: True
# allowed: True, False
pin: False
pin: false

# set the default branch
# default: empty, the default branch on GitHub
Expand All @@ -20,15 +21,16 @@ schedule: "every day"
# search for requirement files
# default: True
# allowed: True, False
search: True
search: true

# Specify requirement files by hand, default is empty
# default: empty
# allowed: list
requirements:
- test-requirements.txt:
pin: False
pin: false

# allow to close stale PRs
# default: True
close_prs: True
close_prs: true
...
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ recursive-include docs *.txt
recursive-exclude *.pyc *.pyo
include docs/LICENSE.GPL
exclude fastkml/.*
include *.txt
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs Makefile
38 changes: 38 additions & 0 deletions docs/Configuration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Configuration
==============

ElementTree configuration
--------------------------

By default, fastkml uses the standard libraries
``xml.etree.ElementTree`` or, if installed, ``lxml.etree``
as its parser, but you can change this by setting the
``fastkml.config.etree`` module variable to a different
implementation.

E.g. if you have lxml installed, but you want to use the
standard ``xml.etree.ElementTree``, you can do this::

>>> import fastkml.config
>>> import xml.etree.ElementTree
>>> fastkml.config.set_etree_implementation(xml.etree.ElementTree)
>>> fastkml.config.set_default_namespaces()

You can pass any module that implements the ``ElementTree`` interface
to the ``set_etree_implementation`` function.

Registering additional namespaces
----------------------------------
The ``fastkml.config.set_default_namespaces`` function registers
the ``kml``, ``gx`` and ``atom`` namespaces with the ``ElementTree``.
You can add any other namespaces you want to use by calling
``fastkml.config.register_namespace`` with the namespace prefix and
the namespace URI.

.. code-block:: python
>>> import fastkml.config
>>> import xml.etree.ElementTree
>>> fastkml.config.set_etree_implementation(xml.etree.ElementTree)
>>> fastkml.config.register_namespace(foo='http://foo.com')
>>> config.set_default_namespaces()
2 changes: 2 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Changelog
- Drop Python 2 support
- Use pygeoif >=1.0
- Drop shapely native support
- Add type annotations
- refactor


0.12 (2020/09/23)
Expand Down
Loading

0 comments on commit b3a2107

Please sign in to comment.