forked from wmayner/pyemd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure the package to use modern Python packaging methods. - Drop support for Python < 3.7 - Use pyproject.toml - Use cibuildwheel to build wheels for many linux distros - Introduce automation with GitHub actions for builds - Use setuptools_scm to automate versioning - Assume Cython is available when preparing a source distribution
- Loading branch information
Showing
22 changed files
with
226 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2019, macos-11] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
with: | ||
package-dir: . | ||
output-dir: wheelhouse | ||
config-file: "{package}/pyproject.toml" | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
__pycache__ | ||
.gitconfig | ||
.cache | ||
.pytest_cache | ||
.tox | ||
.env | ||
.ropeproject | ||
*.so | ||
*.pyc | ||
MANIFEST | ||
*.egg* | ||
src/pyemd/emd.cpp | ||
src/pyemd/_version.py | ||
build | ||
dist | ||
pyemd/emd.cpp | ||
wheelhouse | ||
ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
graft pyemd | ||
graft src/pyemd | ||
graft test | ||
|
||
include README.rst | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,44 @@ | ||
.PHONY: default test build clean upload-dist test-dist sign-dist check-dist build-dist clean-dist | ||
.PHONY: default clean develop test dist-clean build-local build dist-upload dist-test-upload dist-sign dist-check | ||
|
||
src = pyemd | ||
dist_dir = dist | ||
src = src/pyemd | ||
test = test | ||
dist = wheelhouse | ||
readme = README.rst | ||
|
||
default: build | ||
default: develop | ||
|
||
test: build | ||
py.test | ||
clean: | ||
rm -rf $(shell find . -name '__pycache__') | ||
rm -rf $(shell find . -name '*.so') | ||
rm -rf .eggs | ||
rm -rf pyemd.egg-info | ||
rm -rf dist | ||
rm -rf build | ||
|
||
build: clean | ||
develop: clean | ||
python -m pip install -e . | ||
# setup.py build_ext -b . | ||
|
||
clean: | ||
rm -f pyemd/*.so | ||
rm -rf **/__pycache__ | ||
rm -rf build | ||
rm -rf pyemd.egg-info | ||
test: develop | ||
py.test | ||
|
||
upload-dist: sign-dist | ||
twine upload $(dist_dir)/* | ||
build-local: clean | ||
python -m build | ||
|
||
test-dist: check-dist | ||
twine upload --repository testpypi $(dist_dir)/* | ||
dist-clean: | ||
rm -rf $(dist) | ||
|
||
sign-dist: check-dist | ||
gpg --detach-sign -a dist/*.tar.gz | ||
gpg --detach-sign -a dist/*.whl | ||
build: dist-clean | ||
cibuildwheel --platform linux --config-file pyproject.toml --output-dir $(dist) | ||
|
||
check-dist: build-dist | ||
twine check --strict dist/* | ||
dist-upload: dist-sign | ||
twine upload $(dist)/* | ||
|
||
build-dist: clean-dist | ||
python -m build | ||
# python -m setup.py sdist bdist_wheel --dist-dir=$(dist_dir) | ||
dist-test-upload: dist-check | ||
twine upload --repository testpypi $(dist)/* | ||
|
||
dist-sign: dist-check | ||
gpg --detach-sign -a $(dist)/*.tar.gz | ||
gpg --detach-sign -a $(dist)/*.whl | ||
|
||
clean-dist: | ||
rm -r $(dist_dir) | ||
dist-check: dist-build | ||
twine check --strict $(dist)/* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,43 @@ | ||
[build-system] | ||
requires = ["setuptools>=61.0", "cython", "wheel"] | ||
requires = [ | ||
"cython", | ||
"oldest-supported-numpy", | ||
"setuptools >= 45", | ||
"setuptools_scm", | ||
"wheel", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "pyemd" | ||
version = "0.5.1" | ||
authors = [{ name = "Will Mayner", email = "[email protected]" }] | ||
description = "A Python wrapper for Ofir Pele and Michael Werman's implementation of the Earth Mover's Distance." | ||
readme = "README.md" | ||
license = { file = "LICENSE" } | ||
description = "A Python wrapper for Ofir Pele and Michael Werman's implementation of the Earth Mover's Distance." | ||
authors = [{ name = "Will Mayner", email = "[email protected]" }] | ||
requires-python = ">=3.7" | ||
dependencies = ["numpy >= 1.9.0"] | ||
readme = "README.rst" | ||
classifiers = [ | ||
'Development Status :: 3 - Alpha', | ||
'Development Status :: 5 - Production/Stable', | ||
'Intended Audience :: Developers', | ||
'Natural Language :: English', | ||
'License :: OSI Approved :: MIT License', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 3', | ||
] | ||
dynamic = ['dependencies'] | ||
dynamic = ['version'] | ||
|
||
[project.optional-dependencies] | ||
test = ['pytest'] | ||
dist = ['cibuildwheel', 'setuptools_scm'] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/wmayner/pyemd" | ||
"Bug Tracker" = "https://github.com/wmayner/pyemd/issues" | ||
|
||
[tool.setuptools_scm] | ||
write_to = "src/pyemd/_version.py" | ||
|
||
[tool.cibuildwheel] | ||
skip = "cp36*" | ||
build-verbosity = 2 | ||
test-requires = ["pytest"] | ||
test-command = "py.test {project}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.