Skip to content

Commit c32ed67

Browse files
authored
Fix pypi action (#222)
* force packaging upgrade to 24.2 for twine * Bump version to 0.5.0rc2 * remove universal compatibility option * revert tag * adapt files to new wheel name due to py3
1 parent bea2c04 commit c32ed67

File tree

9 files changed

+22
-13
lines changed

9 files changed

+22
-13
lines changed

.github/workflows/release-pypi.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ jobs:
2828
path: ~/.cache/pip
2929
key: ${{ runner.os }}-pip
3030

31+
- name: Install dependencies
32+
run: |
33+
pip install --upgrade pip
34+
pip install wheel
35+
# NOTE(stes) see https://github.com/pypa/twine/issues/1216#issuecomment-2629069669
36+
pip install "packaging>=24.2"
37+
3138
- name: Checkout code
3239
uses: actions/checkout@v3
3340

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ RUN make dist
4040
FROM cebra-base
4141

4242
# install the cebra wheel
43-
ENV WHEEL=cebra-0.5.0rc1-py2.py3-none-any.whl
43+
ENV WHEEL=cebra-0.5.0rc1-py3-none-any.whl
4444
WORKDIR /build
4545
COPY --from=wheel /build/dist/${WHEEL} .
4646
RUN pip install --no-cache-dir ${WHEEL}'[dev,integrations,datasets]'

PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ build() {
4040

4141
package() {
4242
cd $srcdir/${_pkgname}-${pkgver}
43-
pip install --ignore-installed --no-deps --root="${pkgdir}" dist/${_pkgname}-${pkgver}-py2.py3-none-any.whl
43+
pip install --ignore-installed --no-deps --root="${pkgdir}" dist/${_pkgname}-${pkgver}-py3-none-any.whl
4444
find ${pkgdir} -iname __pycache__ -exec rm -r {} \; 2>/dev/null || echo
4545
install -Dm 644 LICENSE.md $pkgdir/usr/share/licenses/${pkgname}/LICENSE
4646
}

docs/source/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ Enter the build environment and build the package:
155155
host $ make interact
156156
docker $ make build
157157
# ... outputs ...
158-
Successfully built cebra-X.X.XaX-py2.py3-none-any.whl
158+
Successfully built cebra-X.X.XaX-py3-none-any.whl
159159
160160
The built package can be found in ``dist/`` and can be installed locally with
161161

162162
.. code:: bash
163163
164-
pip install dist/cebra-X.X.XaX-py2.py3-none-any.whl
164+
pip install dist/cebra-X.X.XaX-py3-none-any.whl
165165
166166
**Please do not distribute this package prior to the public release of the CEBRA repository, because it also
167167
contains parts of the source code.**

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[build-system]
22
requires = [
33
"setuptools>=43",
4-
"wheel"
4+
"wheel",
5+
"packaging>=24.2"
56
]
67
build-backend = "setuptools.build_meta"
78

reinstall.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ python3 -m pip install --upgrade build
2424
python3 -m build --sdist --wheel .
2525

2626
# Reinstall the package with most recent version
27-
pip install --upgrade --no-cache-dir "dist/cebra-${VERSION}-py2.py3-none-any.whl[datasets,integrations]"
27+
pip install --upgrade --no-cache-dir "dist/cebra-${VERSION}-py3-none-any.whl[datasets,integrations]"

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,3 @@ dev =
112112
# docformatter[tomli]
113113
codespell
114114
cffconvert
115-
116-
[bdist_wheel]
117-
universal=1

tools/build_docs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ FROM python:3.9
6262
RUN python -m pip install --upgrade pip setuptools wheel \
6363
&& apt-get update -y && apt-get install -y pandoc git
6464
RUN pip install torch --extra-index-url=https://download.pytorch.org/whl/cpu
65-
COPY dist/cebra-0.4.0-py2.py3-none-any.whl .
66-
RUN pip install 'cebra-0.4.0-py2.py3-none-any.whl[docs]'
65+
COPY dist/cebra-0.5.0rc1-py3-none-any.whl .
66+
RUN pip install 'cebra-0.5.0rc1-py3-none-any.whl[docs]'
6767
EOF
6868

6969
checkout_cebra_figures

tools/bump_version.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@ $SED_CMD "s/CEBRA_VERSION := .*/CEBRA_VERSION := ${version}/" Makefile
3737
$SED_CMD "s/pkgver=.*/pkgver=${version}/" PKGBUILD
3838

3939
# Dockerfile
40-
$SED_CMD "s/ENV WHEEL=cebra-.*\.whl/ENV WHEEL=cebra-${version}-py2.py3-none-any.whl/" Dockerfile
40+
$SED_CMD "s/ENV WHEEL=cebra-.*\.whl/ENV WHEEL=cebra-${version}-py3-none-any.whl/" Dockerfile
41+
42+
# build_docs.sh
43+
$SED_CMD "s/COPY dist\/cebra-.*-py3-none-any\.whl/COPY dist\/cebra-${version}-py3-none-any.whl/" tools/build_docs.sh
44+
$SED_CMD "s/RUN pip install 'cebra-.*-py3-none-any\.whl/RUN pip install 'cebra-${version}-py3-none-any.whl/" tools/build_docs.sh
4145

4246
# Remove backup files
4347
if [[ "$OSTYPE" == "darwin"* ]]; then
44-
rm cebra/__init__.py.bkp reinstall.sh.bkp Makefile.bkp PKGBUILD.bkp Dockerfile.bkp
48+
rm cebra/__init__.py.bkp reinstall.sh.bkp Makefile.bkp PKGBUILD.bkp Dockerfile.bkp tools/build_docs.sh.bkp
4549
fi

0 commit comments

Comments
 (0)