Skip to content

Commit

Permalink
Update PyPi Build (#81)
Browse files Browse the repository at this point in the history
* Update cibuildwheel version

* Fix Interval __str__ and __repr__

* Switch to release PyPi
  • Loading branch information
zfergus authored Dec 12, 2023
1 parent 4bde021 commit f9969cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- uses: actions/[email protected]

- name: Build wheels
uses: pypa/cibuildwheel@v2.12.1
uses: pypa/cibuildwheel@v2.16.2
# to supply options, put them in 'env', like:
env:
MACOSX_DEPLOYMENT_TARGET: "10.14"
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
with:
user: __token__
# To test:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
# To release:
# password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN }}
10 changes: 6 additions & 4 deletions python/src/utils/interval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@ void define_interval(py::module_& m)
.def(
"__str__",
[](const Interval& self) {
return (std::stringstream() << self).str();
std::stringstream ss;
ss << self;
return ss.str();
})
.def(
"__repr__",
[](const Interval& self) {
return (std::stringstream()
<< "Interval(" << self.INF << ", " << self.SUP << ")")
.str();
std::stringstream ss;
ss << "Interval(" << self.INF << ", " << self.SUP << ")";
return ss.str();
})
.DEF_BIN_OP("add", a + b)
.DEF_UN_OP("pos", +i)
Expand Down

0 comments on commit f9969cb

Please sign in to comment.