Skip to content

Overhaul repo infrastructure #353

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

Merged
merged 16 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/310.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- scipy>=1.3.2
- shapely
- spaghetti
- tqdm=>4.27.0
- tqdm>=4.27.0
# testing
- codecov
- coverage
Expand Down
11 changes: 10 additions & 1 deletion .ci/311-DEV.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ channels:
- conda-forge
dependencies:
- python=3.11
- geopandas>=0.10.0
- geopandas
- folium
- libpysal
- mapclassify
- matplotlib
- networkx
- numpy>=1.21
Expand All @@ -19,3 +22,9 @@ dependencies:
- pytest
- pytest-cov
- pytest-xdist
- pip:
- git+https://github.com/geopandas/geopandas.git
- git+https://github.com/networkx/networkx.git
- git+https://github.com/pysal/libpysal.git
- git+https://github.com/pysal/mapclassify.git
- git+https://github.com/pysal/spaghetti.git
23 changes: 0 additions & 23 deletions .ci/311-DEV_shapely_dev.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions .ci/311.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ channels:
- conda-forge
dependencies:
- python=3.11
- geopandas>=0.10.0
- geopandas
- libpysal
- matplotlib
- networkx
- numpy>=1.21
- pandas>=1.0.5
- scikit-learn>=0.22
- scipy>=1.3.2
- shapely
- spaghetti
- tqdm=>4.27.0
# testing
Expand Down
2 changes: 1 addition & 1 deletion .ci/39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
dependencies:
- python=3.9
- geopandas>=0.10.0
- geopandas
- libpysal
- matplotlib
- networkx
Expand Down
31 changes: 0 additions & 31 deletions .coveragerc

This file was deleted.

22 changes: 13 additions & 9 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
runs-on: ${{ matrix.os }}
timeout-minutes: 30
env:
RUN_TEST: pytest spopt -v -r a -n auto --cov spopt --cov-config .coveragerc --cov-report xml --color yes --cov-append --cov-report term-missing
RUN_TEST: pytest spopt -v -r a -n auto --cov spopt --color yes --cov-report term-missing --cov-append --cov-report xml .
strategy:
matrix:
os: [ubuntu-latest]
Expand All @@ -26,7 +26,6 @@
.ci/310.yaml,
.ci/311.yaml,
.ci/311-DEV.yaml,
.ci/311-DEV_shapely_dev.yaml,
]
include:
- environment-file: .ci/311.yaml
Expand All @@ -48,12 +47,7 @@

- name: install pulp via pip
shell: bash -l {0}
run: pip install pulp

- name: install bleeding edge libpysal (only Ubuntu w/ latest Python)
shell: bash -l {0}
run: pip install git+https://github.com/pysal/libpysal.git@master
if: matrix.os == 'ubuntu-latest' && contains(matrix.environment-file, 'DEV')
run: pip install pulp

- name: environment info
shell: bash -l {0}
Expand All @@ -80,4 +74,14 @@
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
name: spot-codecov
name: spopt-codecov

- name: Generate and publish the report
if: |
failure()
&& steps.status.outcome == 'failure'
&& github.event_name == 'schedule'
&& github.repository_owner == 'pysal'
uses: xarray-contrib/issue-from-pytest-log@v1
with:
log-path: pytest-log.jsonl
50 changes: 0 additions & 50 deletions .github/workflows/versioneer.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ lib
lib64
__pycache__

.coverage
.coverage

.ruff_cache
.pytest_cache
14 changes: 11 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
files: 'spopt\/'
repos:
- repo: https://github.com/psf/black
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
language_version: python3
- id: black
language_version: python3
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.252"
hooks:
- id: ruff

ci:
autofix_prs: false
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
codecov:
notify:
after_n_builds: 8
after_n_builds: 7
coverage:
range: 50..95
round: nearest
Expand All @@ -18,5 +18,5 @@ coverage:
comment:
layout: "reach, diff, files"
behavior: once
after_n_builds: 8
after_n_builds: 7
require_changes: true
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
dependencies:
- python=3.10
- geopandas>=0.10.0
- geopandas>=0.12.0
- jupyterlab
- libpysal
- mapclassify
Expand All @@ -14,6 +14,7 @@ dependencies:
- pulp
- scikit-learn>=0.22
- scipy>=1.3.2
- shapely>=2.0
- tqdm>=4.27.0

# notebook/binder specific
Expand Down
106 changes: 106 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
[build-system]
requires = ["setuptools>=61.0", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[project]
name = "spopt"
dynamic = ["version"]
authors = [
{ name = "James D. Gaboardi", email = "jgaboardi@gmail.com" },
{ name = "Xin Feng", email = "xin.feng@ucr.edu" },
]

maintainers = [{ name = "spopt contributors" }]
license = { text = "BSD 3-Clause" }
description = "Spatial Optimization in PySAL"
keywords = ["spatial optimization"]
readme = { text = """\
Spopt is an open-source Python library for solving optimization problems with spatial data. Originating from the `region` module in `PySAL`_ (Python Spatial Analysis Library), it is under active development for the inclusion of newly proposed models and methods for regionalization, facility location, and transportation-oriented solutions.

.. _PySAL: http://pysal.org
""", content-type = "text/x-rst" }
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: GIS",
]
requires-python = ">=3.8"
dependencies = [
"geopandas>=0.10.0",
"libpysal",
"mapclassify",
"networkx",
"numpy>=1.21",
"pandas>=1.0.5",
"pulp",
"scikit-learn>=0.22",
"scipy>=1.3.2",
"spaghetti",
"tqdm>=4.27.0",
]


[project.urls]
Home = "https://pysal.org/spopt/"
Repository = "https://github.com/pysal/spopt"

[project.optional-dependencies]
tests = [
"codecov",
"coverage",
"pytest",
"pytest-cov",
"pytest-xdist",
]
dev = ["pre-commit"]
docs = [
"nbsphinx",
"numpydoc",
"pandoc",
"sphinx",
"sphinxcontrib-bibtex",
"sphinx_bootstrap_theme",
]
notebooks = [
"folium",
"glpk",
"inequality",
"matplotlib",
"matplotlib-scalebar",
"overpy",
"routingpy",
"seaborn",
"watermark",
]


[tool.setuptools.packages.find]
include = ["spopt", "spopt.*"]

[tool.black]
line-length = 88

[tool.ruff]
line-length = 88
select = ["E", "F", "W", "I", "UP", "N", "B", "A", "C4", "SIM", "ARG"]
target-version = "py311"
ignore = ["B006", "F401", "F403"]
exclude = ["spopt/tests/*", "docs/*"]

[tool.coverage.run]
source = ["spopt"]

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

This file was deleted.

3 changes: 0 additions & 3 deletions requirements_dev.txt

This file was deleted.

Loading