Skip to content

Commit 3768910

Browse files
authored
Merge pull request #40 from martinfleis/infra
MAINT: update infrastructure
2 parents 7af414a + 61a8084 commit 3768910

21 files changed

+250
-2852
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore-for-release
5+
authors:
6+
- dependabot
7+
categories:
8+
- title: Bug Fixes
9+
labels:
10+
- bug
11+
- title: Enhancements
12+
labels:
13+
- enhancement
14+
- title: Maintenance
15+
labels:
16+
- maintenance
17+
- title: Other Changes
18+
labels:
19+
- "*"

.github/workflows/release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Release package on GitHub and publish to PyPI
2+
3+
# Important: In order to trigger this workflow for the organization
4+
# repo (organzation-name/repo-name vs. user-name/repo-name), a tagged
5+
# commit must be made to *organzation-name/repo-name*. If the tagged
6+
# commit is made to *user-name/repo-name*, a release will be published
7+
# under the user's name, not the organzation.
8+
9+
#--------------------------------------------------
10+
name: Release & Publish
11+
12+
on:
13+
push:
14+
# Sequence of patterns matched against refs/tags
15+
tags:
16+
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
17+
workflow_dispatch:
18+
inputs:
19+
version:
20+
description: Manual Release
21+
default: test
22+
required: false
23+
24+
jobs:
25+
build:
26+
name: Create release & publish to PyPI
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout repo
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0 # Fetch all history for all branches and tags.
34+
35+
- name: Set up python
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: "3.x"
39+
40+
- name: Install Dependencies
41+
run: |
42+
python -m pip install --upgrade pip build twine
43+
python -m build
44+
twine check --strict dist/*
45+
46+
- name: Create Release Notes
47+
uses: actions/github-script@v7
48+
with:
49+
github-token: ${{secrets.GITHUB_TOKEN}}
50+
script: |
51+
await github.request(`POST /repos/${{ github.repository }}/releases`, {
52+
tag_name: "${{ github.ref }}",
53+
generate_release_notes: true
54+
});
55+
56+
- name: Publish distribution 📦 to PyPI
57+
uses: pypa/gh-action-pypi-publish@release/v1
58+
with:
59+
user: __token__
60+
password: ${{ secrets.PYPI_PASSWORD }}

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
files: 'geoplanar\/'
2+
repos:
3+
- repo: https://github.com/astral-sh/ruff-pre-commit
4+
rev: v0.4.2
5+
hooks:
6+
- id: ruff
7+
- id: ruff-format
8+
9+
ci:
10+
autofix_prs: false
11+
autoupdate_schedule: quarterly

MANIFEST.in

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/conf.py

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,26 @@
44
# list see the documentation:
55
# https://www.sphinx-doc.org/en/master/usage/configuration.html
66

7-
import os
8-
import pathlib
9-
import shutil
10-
import subprocess
11-
12-
137
# -- Path setup --------------------------------------------------------------
14-
158
# If extensions (or modules to document with autodoc) are in another directory,
169
# add these directories to sys.path here. If the directory is relative to the
1710
# documentation root, use os.path.abspath to make it absolute, like shown here.
1811
#
1912
import os
13+
import pathlib
14+
import shutil
15+
import subprocess
2016
import sys
21-
sys.path.insert(0, os.path.abspath('../'))
17+
18+
sys.path.insert(0, os.path.abspath("../"))
2219

2320

2421
# -- Project information -----------------------------------------------------
2522
import geoplanar
2623

27-
project = 'geoplanar'
28-
copyright = '2021-, Serge Rey & geoplanar contributors'
29-
author = 'Serge Rey & geoplanar contributors'
24+
project = "geoplanar"
25+
copyright = "2021-, Serge Rey & geoplanar contributors"
26+
author = "Serge Rey & geoplanar contributors"
3027

3128
# The full version, including alpha/beta/rc tags
3229
release = geoplanar.__version__
@@ -38,42 +35,38 @@
3835
# Add any Sphinx extension module names here, as strings. They can be
3936
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4037
# ones.
41-
extensions = [
42-
"sphinx.ext.autodoc",
43-
"numpydoc",
44-
"nbsphinx"
45-
]
38+
extensions = ["sphinx.ext.autodoc", "numpydoc", "nbsphinx"]
4639

4740
# nbsphinx do not use requirejs (breaks bootstrap)
4841
nbsphinx_requirejs_path = ""
4942

5043
# Add any paths that contain templates here, relative to this directory.
51-
templates_path = ['_templates']
44+
templates_path = ["_templates"]
5245

5346
# List of patterns, relative to source directory, that match files and
5447
# directories to ignore when looking for source files.
5548
# This pattern also affects html_static_path and html_extra_path.
56-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
49+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
5750

5851

5952
# -- Options for HTML output -------------------------------------------------
6053

6154
# The theme to use for HTML and HTML Help pages. See the documentation for
6255
# a list of builtin themes.
6356
#
64-
html_theme = 'pydata_sphinx_theme'
57+
html_theme = "pydata_sphinx_theme"
6558

6659
# Add any paths that contain custom static files (such as style sheets) here,
6760
# relative to this directory. They are copied after the builtin static files,
6861
# so a file named "default.css" will overwrite the builtin "default.css".
69-
html_static_path = ['_static']
62+
html_static_path = ["_static"]
7063

7164
html_css_files = [
72-
'css/custom.css',
65+
"css/custom.css",
7366
]
7467

7568
html_sidebars = {
76-
'**': ['docs-sidebar.html'],
69+
"**": ["docs-sidebar.html"],
7770
}
7871

7972
# ---------------------------------------------------------------------------
@@ -99,4 +92,4 @@
9992

10093
# convert README to rst
10194

102-
subprocess.check_output(['pandoc','--to', 'rst', '-o', 'README.rst', '../README.md'])
95+
subprocess.check_output(["pandoc", "--to", "rst", "-o", "README.rst", "../README.md"])

geoplanar/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
A module for handling planar enforcement for polygon geoseries.
55
"""
66

7-
from geoplanar.overlap import trim_overlaps, is_overlapping, overlaps
8-
from geoplanar.gap import (gaps, fill_gaps)
9-
from geoplanar.hole import (add_interiors, missing_interiors)
10-
from geoplanar.planar import (planar_enforce, is_planar_enforced,
11-
fix_npe_edges, insert_intersections,
12-
non_planar_edges, check_validity,
13-
self_intersecting_rings)
14-
from geoplanar.valid import isvalid
7+
import contextlib
8+
from importlib.metadata import PackageNotFoundError, version
159

16-
from . import _version
17-
__version__ = _version.get_versions()['version']
10+
from geoplanar.gap import *
11+
from geoplanar.hole import *
12+
from geoplanar.overlap import *
13+
from geoplanar.planar import *
14+
from geoplanar.valid import *
15+
16+
with contextlib.suppress(PackageNotFoundError):
17+
__version__ = version("geoplanar")

0 commit comments

Comments
 (0)