Skip to content

Commit

Permalink
Overhaul repo infrastructure (#721)
Browse files Browse the repository at this point in the history
* update pre-commit

* update infrastructure

* ruff [1]

* ruffen repo [2]

* update infra [2]

* update extract_comp() stacklevel

* noqa ARG001 for geom_col for now
  • Loading branch information
jGaboardi authored May 24, 2023
1 parent 7dfb5e3 commit b1feadd
Show file tree
Hide file tree
Showing 17 changed files with 176 additions and 3,262 deletions.
33 changes: 0 additions & 33 deletions .coveragerc

This file was deleted.

5 changes: 3 additions & 2 deletions .github/workflows/release_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine jupyter urllib3 pandas pyyaml
python setup.py sdist bdist_wheel
python -m pip install --upgrade build twine
python -m build
twine check --strict dist/*
- name: Create Release Notes
uses: actions/github-script@v6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
testing:
needs: linting
env:
RUN_TEST: pytest spaghetti -v -r a -n auto --cov spaghetti --doctest-modules --cov-config .coveragerc --cov-report xml --color yes --cov-append --cov-report term-missing --timeout 60
RUN_TEST: pytest spaghetti -v -r a -n auto --cov spaghetti --doctest-modules --cov-report xml --color yes --cov-append --cov-report term-missing --timeout 60
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
Expand Down
50 changes: 0 additions & 50 deletions .github/workflows/versioneer.yml

This file was deleted.

30 changes: 13 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
files: 'spaghetti\/'
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
entry: pflake8
additional_dependencies: [pyproject-flake8]
language_version: python3
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.265"
hooks:
- id: ruff

ci:
autofix_prs: false
2 changes: 0 additions & 2 deletions .pylintrc

This file was deleted.

3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: notebooks-environment
channels:
- conda-forge
dependencies:
- python=3.10
- python=3.11
- esda
- geopandas>=0.12.0
- libspatialindex
Expand Down
81 changes: 39 additions & 42 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
[build-system]
requires = [
"black",
"isort",
"pyproject-flake8",
"setuptools>=61.0.0",
"versioneer[toml]",

]
requires = ["setuptools>=61.0", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[project]
name = "spaghetti"
dynamic = ["version"]
Expand Down Expand Up @@ -55,10 +50,8 @@ Repository = "https://github.com/pysal/spaghetti"
[project.optional-dependencies]
dev = [
"black",
"flake8",
"isort",
"ruff",
"pre-commit",
"pyproject-flake8",
]
docs = [
"nbsphinx",
Expand Down Expand Up @@ -100,40 +93,44 @@ include = [
"spaghetti.*",
]

[tool.versioneer]
VCS = "git"
style = "pep440"
versionfile_source = "spaghetti/_version.py"
versionfile_build = "spaghetti/_version.py"
tag_prefix = "v"
parentdir_prefix = "spaghetti-"

[tool.isort]
profile = "black"
src_paths = ["spaghetti"]
skip = [
"docs/conf.py",
"versioneer.py",
"spaghetti/_version.py"
]

[tool.flake8]
max_line_length = 88
per-file-ignores = [
"*__init__.py:F401",
]
exclude = [
"docs/conf.py",
"versioneer.py",
"spaghetti/_version.py"
]

[tool.black]
line-length = 88
extend-exclude = '''
(
docs/conf.py
"versioneer.py",
"spaghetti/_version.py"
)
'''
#'''

[tool.ruff]
line-length = 88
select = ["E", "F", "W", "I", "UP", "N", "B", "A", "C4", "SIM", "ARG"]
target-version = "py38"
ignore = [
"B006",
"B008",
"B009",
"B010",
"C408",
"E731",
"F401",
"F403",
"N803",
"N806",
"N999",
"UP007"
]
exclude = ["spaghetti/tests/*", "docs/*"]

[tool.coverage.run]
source = ["./spaghetti"]

[tool.coverage.report]
exclude_lines = [
"if self.debug:",
"pragma: no cover",
"raise NotImplementedError",
"except ModuleNotFoundError:",
"except ImportError",
]
ignore_errors = true
omit = ["spaghetti/tests/*", "docs/conf.py"]
18 changes: 0 additions & 18 deletions setup.py

This file was deleted.

7 changes: 5 additions & 2 deletions spaghetti/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# `spaghetti` --- Spatial Graphs: Networks, Topology, & Inference
"""

from . import _version
import contextlib
from importlib.metadata import PackageNotFoundError, version

from .network import (
Network,
PointPattern,
Expand All @@ -13,4 +15,5 @@
spanning_tree,
)

__version__ = _version.get_versions()["version"]
with contextlib.suppress(PackageNotFoundError):
__version__ = version("spaghetti")
Loading

0 comments on commit b1feadd

Please sign in to comment.