From 0da02bf748a32852b1ee12333220b658e1abe502 Mon Sep 17 00:00:00 2001 From: Jan Funke Date: Mon, 13 Mar 2023 16:23:35 -0400 Subject: [PATCH 1/5] Update submodule solvers --- ilpy/impl/solvers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ilpy/impl/solvers b/ilpy/impl/solvers index 545f428..34730fc 160000 --- a/ilpy/impl/solvers +++ b/ilpy/impl/solvers @@ -1 +1 @@ -Subproject commit 545f428a83afb7e5dac7efda3df69c8db9c18f3b +Subproject commit 34730fc974c7463ff244103318d4dff24c1f26ed From 901319d9342fb87c2150d07a2d35d61eba843cef Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 13 Mar 2023 17:46:11 -0400 Subject: [PATCH 2/5] update pyproject --- ilpy/__init__.py | 2 +- pyproject.toml | 23 +++++++++++++++++++++++ setup.py | 43 ++++++++++++------------------------------- 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/ilpy/__init__.py b/ilpy/__init__.py index eee0d9a..5083cb4 100644 --- a/ilpy/__init__.py +++ b/ilpy/__init__.py @@ -1,3 +1,3 @@ from .wrapper import * -__version__ = "0.2.2" +__version__ = "0.2.3" diff --git a/pyproject.toml b/pyproject.toml index 056f67a..934328d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,3 +2,26 @@ [build-system] requires = ["setuptools", "Cython"] build-backend = "setuptools.build_meta" + +# https://peps.python.org/pep-0621/ +[project] +name = "ilpy" +description = "Python wrappers for popular MIP solvers." +requires-python = ">=3.8" +license = { text = "MIT" } +authors = [{ email = "funkej@janelia.hhmi.org", name = "Jan Funke" }] +dynamic = ["version", "readme"] +dependencies = [] + +# extras +# https://peps.python.org/pep-0621/#dependencies-optional-dependencies +[project.optional-dependencies] +dev = ["flake8", "pytest", "pytest-cov"] + +[project.urls] +homepage = "https://github.com/funkelab/ilpy" +repository = "https://github.com/funkelab/ilpy" + +[tool.setuptools.dynamic] +version = {attr = "ilpy.__version__"} +readme = {file = ["README.md"]} diff --git a/setup.py b/setup.py index a001440..3b3f496 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from setuptools.extension import Extension libraries = ["libscip"] if os.name == "nt" else ["scip"] -include_dirs = ['ilpy/impl'] +include_dirs = ["ilpy/impl"] library_dirs = [] compile_args = ["-O3", "-std=c++11", "-DHAVE_SCIP"] @@ -21,7 +21,7 @@ # look for various gurobi versions, which are annoyingly # suffixed with the version number, and wildcards don't work for v in ["100"]: - GUROBI_LIB = f"libgurobi{v}" if os.name == 'nt' else f"gurobi{v}" + GUROBI_LIB = f"libgurobi{v}" if os.name == "nt" else f"gurobi{v}" if (gurolib := util.find_library(GUROBI_LIB)) is not None: print("FOUND GUROBI library: ", gurolib) libraries.append(GUROBI_LIB) @@ -31,33 +31,14 @@ print("WARNING: GUROBI library not found") -setup( - name='ilpy', - version='0.2.2', - description='Python wrappers for popular MIP solvers.', - url='https://github.com/funkelab/ilpy', - author='Jan Funke', - author_email='funkej@janelia.hhmi.org', - license='MIT', - packages=[ - 'ilpy' - ], - ext_modules=cythonize([ - Extension( - 'ilpy.wrapper', - sources=[ - 'ilpy/wrapper.pyx', - ], - extra_compile_args=compile_args, - include_dirs=include_dirs, - libraries=libraries, - library_dirs=library_dirs, - language='c++') - ]), - extras_require={ - "dev": ["flake8", "pytest", "pytest-cov"], - }, - package_data={ - "ilpy": ["py.typed", "*.pyi"] - }, +wrapper = Extension( + "ilpy.wrapper", + sources=["ilpy/wrapper.pyx"], + extra_compile_args=compile_args, + include_dirs=include_dirs, + libraries=libraries, + library_dirs=library_dirs, + language="c++", ) + +setup(ext_modules=cythonize([wrapper])) From b1489ce695121e66496e3feb2cd6e9eedd7587dd Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 13 Mar 2023 17:51:06 -0400 Subject: [PATCH 3/5] add back package data --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3b3f496..3aa607c 100644 --- a/setup.py +++ b/setup.py @@ -41,4 +41,7 @@ language="c++", ) -setup(ext_modules=cythonize([wrapper])) +setup( + ext_modules=cythonize([wrapper]), + package_data={"ilpy": ["py.typed", "*.pyi"]}, +) From c67f7208b23d2afcc375659d79329bdef2438f57 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 13 Mar 2023 18:00:00 -0400 Subject: [PATCH 4/5] add package data --- pyproject.toml | 8 ++++++-- setup.py | 5 +---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 934328d..38fdfb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,10 @@ dev = ["flake8", "pytest", "pytest-cov"] homepage = "https://github.com/funkelab/ilpy" repository = "https://github.com/funkelab/ilpy" +[tool.setuptools] +packages = ["ilpy"] +package-data = { "ilpy" = ["py.typed", "*.pyi"] } + [tool.setuptools.dynamic] -version = {attr = "ilpy.__version__"} -readme = {file = ["README.md"]} +version = { attr = "ilpy.__version__" } +readme = { file = ["README.md"] } diff --git a/setup.py b/setup.py index 3aa607c..3b3f496 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,4 @@ language="c++", ) -setup( - ext_modules=cythonize([wrapper]), - package_data={"ilpy": ["py.typed", "*.pyi"]}, -) +setup(ext_modules=cythonize([wrapper])) From 9d0f8b62d3ed489719e768c86ff33b19613aacb8 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 13 Mar 2023 18:00:54 -0400 Subject: [PATCH 5/5] update readme --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ae8f08b..1d8fba0 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,9 @@ pip install -e .[dev] > Only for maintainers -bump the version in both `setup.py` and `__init__.py` (unless you later -setup auto versioning), and commit it. Then create an annotated tag with: +Bump the version in `__init__.py` and commit it. + +Then create an annotated tag with: ```bash git tag -a vX.Y.Z -m "vX.Y.Z"