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

(draft for testing) #60

Closed
wants to merge 9 commits into from
Closed
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: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
History
=======

1.2.2 (2024-08-29)
------------------
* Fix wheel builds

1.2.1 (2024-08-05)
------------------

Expand Down
6 changes: 2 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include *.rst
include Makefile
recursive-include examples *.ipynb
recursive-include src *.h
exclude examples/*
include src/_mt2/*.h
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ clean: clean-build clean-pyc clean-venv
.PHONY: clean-build
clean-build:
rm -rf build/
rm -rf testdir/
rm -rf dist/
rm -rf .eggs/
rm -rf src/*.egg-info/
find . -name '*.egg-info' -delete
find . -name '*.egg' -delete
find . -name '*.so' -delete

.PHONY: clean-pyc
clean-pyc:
Expand All @@ -27,3 +30,21 @@ clean-venv:
.PHONY: test
test: install
uv run --locked python -m unittest discover tests

.PHONY: build
build: install
@# Slightly disgusting; just installing the `build` module into the working venv and
@# removing after we're done.
uv pip install build
uv run python -m build
uv pip uninstall build

.PHONY: test_wheel
test_wheel: clean build
@# Build the wheel, then install it and check that we can import it.
rm -rf testdir && mkdir testdir
cd testdir && uv venv
cd testdir && uv pip install `find ../dist/ -name *.whl`
testdir/.venv/bin/python -c "from mt2 import mt2"
rm -r testdir

7 changes: 1 addition & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mt2"
version = "1.2.1"
version = "1.2.2"
description = "Stransverse mass computation as a numpy ufunc."
authors = [
{ name = "Tom Gillam", email = "[email protected]" },
Expand Down Expand Up @@ -29,8 +29,3 @@ urls = { Homepage = "https://github.com/tpgillam/mt2" }
requires = ["setuptools>=61.0", "numpy"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
include = ["mt2*"]

[tool.setuptools.package-data]
mt2 = ["src/*.h", "src/*.cpp"]
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import numpy

__version__ = "1.2.1"
__version__ = "1.2.2"

setup(
ext_modules=[
Extension(
"_mt2",
["src/main.cpp"],
"mt2._mt2",
["src/_mt2/main.cpp"],
define_macros=[
# Pass in the version info so we can expose it in the extension.
("VERSION_INFO", __version__),
Expand All @@ -19,7 +19,7 @@
# citation information elsewhere.
("DISABLE_COPYRIGHT_PRINTING", "1"),
],
include_dirs=[numpy.get_include(), "src"],
include_dirs=[numpy.get_include()],
language="c++",
extra_compile_args=["-std=c++11"],
),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions mt2/__init__.py → src/mt2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import numpy

from _mt2 import mt2_lester_ufunc, mt2_tombs_ufunc # pyright: ignore [reportMissingImports]
from mt2._mt2 import mt2_lester_ufunc, mt2_tombs_ufunc # pyright: ignore [reportMissingImports]

__version__ = "1.2.1"
__version__ = "1.2.2"

__all__ = ["mt2", "mt2_arxiv", "mt2_ufunc"]

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from _mt2 import mt2_lally_ufunc, mt2_lester_ufunc, mt2_tombs_ufunc
from mt2._mt2 import mt2_lally_ufunc, mt2_lester_ufunc, mt2_tombs_ufunc


def mt2_lally(*args, desired_precision_on_mt2=0.0, out=None):
Expand Down