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

infra update - CI, names, linting, format, etc. #224

Merged
merged 2 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
strategy:
matrix:
os: ['ubuntu-latest']
environment-file: [ci/311.yaml]
environment-file: [ci/312-latest.yaml]
experimental: [false]
defaults:
run:
Expand All @@ -30,6 +30,8 @@
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: Setup micromamba
uses: mamba-org/setup-micromamba@v1
Expand Down
50 changes: 32 additions & 18 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,38 @@ jobs:
os: ["ubuntu-latest"]
environment-file:
[
ci/39-min.yaml,
ci/39.yaml,
ci/39-numba.yaml,
ci/310.yaml,
ci/310-numba.yaml,
ci/311.yaml,
ci/311-numba.yaml,
ci/312.yaml,
ci/312-numba.yaml,
ci/39-oldest.yaml,
ci/39-latest.yaml,
ci/39-numba-latest.yaml,
ci/310-oldest.yaml,
ci/310-latest.yaml,
ci/310-numba-latest.yaml,
ci/311-latest.yaml,
ci/311-numba-latest.yaml,
ci/312-latest.yaml,
ci/312-numba-latest.yaml,
ci/312-dev.yaml,
]
include:
- environment-file: ci/312.yaml
- environment-file: ci/312-latest.yaml
os: macos-13 # Intel
- environment-file: ci/312-numba.yaml
- environment-file: ci/312-numba-latest.yaml
os: macos-13 # Intel
- environment-file: ci/312.yaml
- environment-file: ci/312-latest.yaml
os: macos-14 # Apple Silicon
- environment-file: ci/312-numba.yaml
- environment-file: ci/312-numba-latest.yaml
os: macos-14 # Apple Silicon
- environment-file: ci/312.yaml
- environment-file: ci/312-latest.yaml
os: windows-latest
- environment-file: ci/312-numba.yaml
- environment-file: ci/312-numba-latest.yaml
os: windows-latest
fail-fast: false

steps:
- name: checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: setup micromamba
uses: mamba-org/setup-micromamba@v1
Expand All @@ -69,17 +72,28 @@ jobs:

- name: Run pytest
run: |
pytest mapclassify -r a -v -n auto --cov mapclassify --cov-report xml --color yes --cov-append --cov-report term-missing
pytest \
mapclassify \
-r a \
-v \
-n auto \
--color yes \
--cov-append \
--cov mapclassify \
--cov-report xml \
--cov-report term-missing

- name: run docstring tests
if: contains(matrix.environment-file, '312-numba') && contains(matrix.os, 'ubuntu')
if: contains(matrix.environment-file, '312-numba-latest') && contains(matrix.os, 'ubuntu')
run: |
pytest \
-v \
-r a \
-n auto \
--color yes \
--cov mapclassify --cov-report xml --cov-append \
--cov-append \
--cov mapclassify \
--cov-report xml \
--doctest-only \
--mpl mapclassify

Expand Down
8 changes: 2 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
files: 'mapclassify\/'
repos:
- repo: https://github.com/psf/black
rev: "24.4.2"
hooks:
- id: black
language_version: python3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.0"
rev: "v0.5.1"
hooks:
- id: ruff
- id: ruff-format

ci:
autofix_prs: false
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![PyPI version](https://badge.fury.io/py/mapclassify.svg)](https://badge.fury.io/py/mapclassify)
[![DOI](https://zenodo.org/badge/88918063.svg)](https://zenodo.org/badge/latestdoi/88918063)
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pysal/mapclassify/main)

`mapclassify` implements a family of classification schemes for choropleth maps.
Expand Down Expand Up @@ -418,4 +418,3 @@ conda activate mapclassify
conda remove -n mapclassify mapclassify
pip install -e .
```

File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions ci/310-oldest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.10
# required
- networkx=2.7
- numpy=1.23
- pandas=1.4
- scikit-learn=1.0
- scipy=1.8
# testing
- geopandas<1
- libpysal
- pytest
- pytest-cov
- pytest-xdist
- codecov
- matplotlib=3.5
7 changes: 0 additions & 7 deletions ci/311.yaml → ci/311-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,3 @@ dependencies:
- pytest-mpl
- codecov
- matplotlib
# docs
- nbsphinx
- numpydoc
- sphinx
- sphinx-gallery
- sphinxcontrib-bibtex
- sphinx_bootstrap_theme
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Installation
============

mapclassify supports python `3.9`_, `3.10`_, and `3.11`_. Please make sure that you are
mapclassify supports python `3.9`_, `3.10`_, `3.11`_, and `3.12`_. Please make sure that you are
operating in a python 3 environment.

Installing released version
Expand Down Expand Up @@ -44,6 +44,7 @@ contribute to mapclassify development.
.. _3.9: https://docs.python.org/3.9/
.. _3.10: https://docs.python.org/3.10/
.. _3.11: https://docs.python.org/3.11/
.. _3.12: https://docs.python.org/3.12/
.. _conda: https://docs.conda.io/en/latest/
.. _conda-forge: https://anaconda.org/conda-forge/mapclassify
.. _Python Package Index: https://pypi.org/project/mapclassify/
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: mapclassify
channels:
- conda-forge
dependencies:
- python=3.11
- python
- geopandas
- git
- ipywidgets
Expand Down
22 changes: 10 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,14 @@ Home = "https://pysal.org/mapclassify/"
Repository = "https://github.com/pysal/mapclassify"

[project.optional-dependencies]
speedups = ["numba>=0.54"]
dev = ["black", "ruff", "pre-commit"]
speedups = [
"numba>=0.54"
]
dev = [
"ruff",
"pre-commit",
"watermark",
]
docs = [
"nbsphinx",
"numpydoc",
Expand All @@ -77,18 +83,10 @@ all = ["numba[speedups,dev,docs,tests]"]
[tool.setuptools.packages.find]
include = ["mapclassify", "mapclassify.*"]

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

[tool.ruff]
line-length = 88
select = ["E", "F", "W", "I", "UP", "N", "B", "A", "C4", "SIM", "ARG"]
ignore = [
lint.select = ["E", "F", "W", "I", "UP", "N", "B", "A", "C4", "SIM", "ARG"]
lint.ignore = [
"B006",
"B008",
"B009",
Expand Down