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

migrate to pyproject #117

Merged
merged 2 commits into from
Sep 13, 2023
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
30 changes: 0 additions & 30 deletions .coveragerc

This file was deleted.

16 changes: 16 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- dependabot
categories:
- title: Bug Fixes
labels:
- bug
- title: Enhancements
labels:
- enhancement
- title: Other Changes
labels:
- "*"
4 changes: 3 additions & 1 deletion .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
micromamba-version: 'latest'

- name: make docs
run: cd docs; make html
run: |
pip install -e . --no-deps --force-reinstall
cd docs; make html

- name: commit docs
run: |
Expand Down
34 changes: 22 additions & 12 deletions .github/workflows/release_and_publish.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Release package on GitHub and publish to PyPI
# IMPORTANT -- 1 MANUAL STEP
# * FOLLOWING TAGGED RELEASE
# - update CHANGELOG.md
# - update CHANGELOG.md
#--------------------------------------------------

name: Build, Release, and publish
name: Release & Publish

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
inputs:
version:
Expand All @@ -24,21 +23,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install dependencies
- 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
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
password: ${{ secrets.PYPI_PASSWORD }}
1 change: 0 additions & 1 deletion CHANGELOG.txt

This file was deleted.

1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

22 changes: 22 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
codecov:
notify:
after_n_builds: 7
coverage:
range: 50..95
round: nearest
precision: 1
status:
project:
default:
threshold: 5%
patch:
default:
threshold: 20%
target: 60%
ignore:
- "tests/*"
comment:
layout: "reach, diff, files"
behavior: once
after_n_builds: 7
require_changes: true
10 changes: 10 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: pointpats
channels:
- conda-forge
- defaults
dependencies:
- pandas
- libpysal
- matplotlib
- pandas
- scipy>=0.11
104 changes: 104 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
[build-system]
requires = ["setuptools>=61.0", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[project]
name = "pointpats"
dynamic = ["version"]
authors = [
{ name = "Serge Rey", email = "sjsrey@gmail.com" },
{ name = "Hu Shao", email = "shaohutiger@gmail.com" },
]
maintainers = [{ name = "pysal contributors" }]
license = { text = "BSD 3-Clause" }
description = "Methods and Functions for planar point pattern analysis"
keywords = [
"spatial statistics, point patterns"
]
readme = { text = """\
"Methods and Functions for planar point pattern analysis"

""", 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.7"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
requires-python = ">=3.7"
requires-python = ">=3.8"

We should also drop 3.8, but that can be in another PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wasnt sure how to set this. Is that what we chose for all the other packages? I figure the minimum supported version isnt the same thing as the minimum required version, and this will probably run on python 3.6+ if i had to guess, so didnt want to force a more recent version, even if its technically unsupported

basically im worried that if we set this too high, it will cause unnecessary install failures, when we should allow people to install unsupported versions if they want

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should just follow SPEC0. Then we don't need to have these discussions.

dependencies = [
"numpy",
"pandas",
"scipy >=1.8",
"libpysal >=4",
"matplotlib"
]

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

[project.optional-dependencies]
dev = ["pre-commit"]
docs = [
"nbsphinx",
"numpydoc",
"pandoc",
"sphinx",
"sphinxcontrib-bibtex",
"sphinx_bootstrap_theme",
"mkdocs-jupyter",
"myst-parser"
]
tests = [
"geopandas",
"codecov",
"coverage",
"pytest",
"pytest-mpl",
"pytest-cov",
"watermark",
]

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

[tool.black]
line-length = 88

[tool.ruff]
line-length = 88
select = ["E", "F", "W", "I", "UP", "N", "B", "A", "C4", "SIM", "ARG"]
target-version = "py39"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should technically be py38, but seems to be safe to leave as is for now, since we will drop 3.8.

ignore = [
"B006",
"B008",
"B009",
"B010",
"C408",
"E731",
"F401",
"F403",
"N803",
"N806",
"N999",
"UP007"
]
exclude = ["pointpats/tests/*", "docs/*"]

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

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

This file was deleted.

5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

6 changes: 0 additions & 6 deletions requirements_tests.txt

This file was deleted.

77 changes: 0 additions & 77 deletions setup.py

This file was deleted.

Loading