Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul repo infrastructure #721

Merged
merged 8 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.9.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 @@ -99,40 +92,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")