Skip to content
Merged
2 changes: 1 addition & 1 deletion .github/workflows/poetry-check-sdist-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/poetry-check-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

the purpose of this build is to check that the build sdist can correctly be installed.

it would be nice to be sure that both the sdist and the wheel that we distribute can be installed correctly, as the problems you have had were introduced without breaking the build.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this issue is now being picked up by the CI. For example, in your PR #59 from yesterday, the sdist builds are failing with the same error I saw on google colab:

https://github.com/jwg4/exact_cover/actions/runs/4088835028/jobs/7050902881

ERROR tests/test_exact_cover.py - ModuleNotFoundError: No module named 'exact_cover_impl'

I think the sdist build problems stem from a breaking change in poetry-core
python-poetry/poetry-core#318
which as of last week's release of poetry-core 1.5.0
https://github.com/python-poetry/poetry-core/releases
no longer generates the setup.py needed for building the binary extension module without us explicitly setting generate-setup-file to true (which is what this PR does, and why the tests are passing in this PR but not PR #59).

The breaking change to poetry-core was only released a week ago, which is why it's only messing up the CI now. In the comments of the poetry PR, one person comments "I am fairly certain releasing this will break for a few folks building extensions using setuptools, just not sure how large the number is going to be." I think it has indeed broken the exact-cover package, but this PR fixes it.

os: [ubuntu-18.04, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-20.04, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/poetry-publish-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
publish:
strategy:
fail-fast: false
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, 'nodeploy')"
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/poetry-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-20.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'nodeploy')"
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/poetry-quick-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-18.04, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-20.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/poetry-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-18.04, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-20.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand Down
24 changes: 14 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@ include = [
]

[tool.poetry.dependencies]
python = "^3.7.1"
numpy = "^1.20"
setuptools = "^51.1.2"
pytest-fail-slow = "^0.2.0"
python = ">=3.7,<4.0"
numpy = [
{version = ">=1.20", python = ">=3.7,<3.10"},
{version = ">=1.23", python = ">=3.10"}
]
setuptools = ">=51.1.2"

[tool.poetry.dev-dependencies]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

not sure why these need to be changed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I changed setuptools (and other things) to be >= rather than ~ as I feel the upper bound constraints are too restrictive (see https://iscinumpy.dev/post/bound-version-constraints/). For example, the latest version of setuptools is 67.1.0 and the exact-cover package works absolutely fine with that. But the current pyproject.toml insists one downgrades to 51.3.3 or earlier as it is written ~51.1.2

The higher numpy versioning is for easier install on more recent pythons. There are no binary wheels for numpy 1.20 for python 3.10 and up. When poetry does its dependency resolving it fetches an old version of numpy that it has to compile from source (which caused difficulty on the CI windows builds). My change here was just to force the newer python to use newer numpy where binary wheels are available.

hypothesis = "^6.56.3"
pytest = "^6.1.2"
flake8 = "^4.0"
black = "^22.3.0"
valgrindci = "^0.2.0"
hypothesis = ">=6.56.3"
pytest = ">=6.1.2"
flake8 = ">=4.0"
black = ">=22.3.0"
valgrindci = ">=0.2.0"
pytest-fail-slow = ">=0.3.0"

[tool.poetry.build]
script = "build.py"
generate-setup-file = true

[tool.poetry.scripts]
test = 'tools.run_tests:test'
Expand All @@ -37,7 +41,7 @@ debug = 'tools.debug:run_debug'
parse_valgrind = 'tools.debug:parse_valgrind_results'

[build-system]
requires = ["setuptools", "numpy>=1.19.4,<2.0", "poetry-core>=1.0.0"]
requires = ["setuptools", "numpy>=1.20.1", "poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
Expand Down