Skip to content

Commit 08b3ad4

Browse files
committed
Introduce pyproject.toml
1 parent 7d39771 commit 08b3ad4

33 files changed

+74
-174
lines changed

.github/workflows/github-ci.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
- name: Set up Python
1616
uses: actions/setup-python@v3
1717
with:
18-
python-version: 3.7
18+
python-version: 3.7.12
1919

2020
- name: Upgrade pip
2121
run: python -m pip install --upgrade pip
2222

2323
- name: Install dependencies
24-
run: python -m pip install flake8 black
24+
run: python -m pip install "flake8==4.0.1" "black==22.3.0"
2525

2626
- name: check style with black
2727
run: python -m black mip --line-length=89 --check --diff
@@ -73,13 +73,12 @@ jobs:
7373
path: ${{ steps.pip-cache.outputs.dir }}
7474
key: ${{ runner.os }}-${{ matrix.python-version }}-pythonpip
7575

76-
- name: Install dependencies CPython
77-
if: ${{ matrix.python-version != 'pypy-3.9' }}
78-
run: python -m pip install cffi pytest networkx numpy matplotlib gurobipy
76+
- name: Install dependencies from requirements.txt
77+
run: python -m pip install -r requirements.txt
7978

80-
- name: Install dependencies PyPy
81-
if: ${{ matrix.python-version == 'pypy-3.9' }}
82-
run: python -m pip install cffi pytest networkx numpy
79+
- name: Install additional requirements (CPython)
80+
if: ${{ matrix.python-version != 'pypy-3.9' }}
81+
run: python -m pip install "matplotlib==3.5.2" "gurobipy==9.5.1"
8382

8483
- name: Install mip
8584
run: python -m pip install .

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ __pycache__/
44
*$py.class
55

66
# Generated by setuptools_scm
7-
mip/version.py
7+
mip/_version.py
88

99
# C extensions
1010
*.so

.travis.yml

-38
This file was deleted.

NEWS

-29
This file was deleted.

TODO.md

-55
This file was deleted.
File renamed without changes.

bench/bench.sh benchmarks/bench.sh

File renamed without changes.

bench/bmcp.py benchmarks/bmcp.py

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.
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.

bench/rcpsp.py benchmarks/rcpsp.py

File renamed without changes.

mip/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
from mip.ndarray import LinExprTensor
88
from mip.entities import Column, Constr, LinExpr, Var, ConflictGraph
99
from mip.model import *
10-
from mip.version import version as __version__
10+
from mip._version import __version__
1111

1212
name = "mip"

mip/_version.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# coding: utf-8
2+
# file generated by setuptools_scm
3+
# don't change, don't track in version control
4+
__version__ = version = '0.0.0'
5+
__version_tuple__ = version_tuple = (0, 0, 0)

mip/model.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import List, Tuple, Optional, Union, Dict, Any
55
import numbers
66
import mip
7-
from .version import version
7+
from ._version import __version__
88

99
logger = logging.getLogger(__name__)
1010

@@ -1631,7 +1631,7 @@ def read_custom_settings():
16311631
customCbcLib = cols[1].lstrip().rstrip().replace('"', "")
16321632

16331633

1634-
logger.info("Using Python-MIP package version {}".format(version))
1634+
logger.info("Using Python-MIP package version {}".format(__version__))
16351635
customCbcLib = ""
16361636
read_custom_settings()
16371637

mip/version.py

-3
This file was deleted.

pyproject.toml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[build-system]
2+
requires = ["setuptools", "setuptools-scm"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "mip"
7+
description = "Python tools for Modeling and Solving Mixed-Integer Linear Programs (MIPs)"
8+
readme = "README.md"
9+
requires-python = ">=3.7"
10+
license = {file = "LICENSE"}
11+
authors = [
12+
{name="T.A.M. Toffolo", email="[email protected]"},
13+
{name="H.G. Santos", email="[email protected]"}
14+
]
15+
maintainers = [
16+
{name="S. Heger", email="[email protected]"}
17+
]
18+
keywords = [
19+
"Optimization",
20+
"Linear Programming",
21+
"Integer Programming",
22+
"Operations Research",
23+
]
24+
classifiers = [
25+
"Development Status :: 5 - Production/Stable",
26+
"License :: OSI Approved :: Eclipse Public License 2.0 (EPL-2.0)",
27+
"Operating System :: OS Independent",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: Implementation :: CPython",
30+
"Programming Language :: Python :: Implementation :: PyPy",
31+
"Topic :: Scientific/Engineering :: Mathematics"
32+
]
33+
dynamic = ["version"]
34+
35+
dependencies = ["cffi==1.15.0"]
36+
37+
[project.optional-dependencies]
38+
numpy = ["numpy==1.22.4"]
39+
gurobi = ["gurobipy>=8.*"]
40+
41+
[project.urls]
42+
"Homepage" = "https://www.python-mip.com"
43+
"Repository" = "https://github.com/coin-or/python-mip"
44+
45+
[tool.setuptools]
46+
packages = ["mip"]
47+
48+
[tool.setuptools.package-data]
49+
"mip.libraries" = ["*.so", "*.dylib", "*.dll"]
50+
51+
[tool.setuptools_scm]
52+
write_to = "mip/_version.py"

requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cffi==1.15.0
2+
networkx==2.6.3
3+
numpy==1.21.6
4+
pytest==7.1.2

scripts/updateDist.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
rm dist/*
2-
python3 setup.py sdist bdist_wheel
2+
python -m pip install build
3+
python -m build

setup.py

-36
This file was deleted.

0 commit comments

Comments
 (0)