[PATCH 3/3] use pip install since setup.py is gone
daniel watson
ozzloy at each.do
Wed Jun 17 02:28:48 BST 2026
use pip install since setup.py is gone.
also grab directory name at runtime instead of hard coding "offlineimap".
the directory is named "offlineimap3" now, so build succeeds with this
change.
Signed-off-by: daniel watson <ozzloy at each.do>
---
Dockerfile | 2 +-
Makefile | 12 +++++++-----
contrib/release.sh | 2 +-
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 91a3be5..b6afcf2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,7 +21,7 @@ RUN /usr/local/bin/python3 -m pip install --upgrade pip && pip install -r requir
COPY . /app-src
# Install the app
-RUN /usr/local/bin/python3 setup.py install
+RUN /usr/local/bin/python3 -m pip install .
##############
# Run tests in a throwaway stage
diff --git a/Makefile b/Makefile
index de346fd..987c9b2 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,7 @@
# Warning: VERSION, ABBREV and TARGZ are used in docs/build-uploads.sh.
VERSION=$(shell ./offlineimap.py --version)
ABBREV=$(shell git rev-parse --short HEAD)
+DIRNAME=$(shell basename $(CURDIR))
TARGZ=offlineimap-v$(VERSION)-$(ABBREV)
SHELL=/bin/bash
RST2HTML=`type rst2html >/dev/null 2>&1 && echo rst2html || echo rst2html.py`
@@ -24,13 +25,14 @@ RST2HTML=`type rst2html >/dev/null 2>&1 && echo rst2html || echo rst2html.py`
all: build
build:
- python setup.py build
+ python -m build
@echo
- @echo "Build process finished, run 'python setup.py install' to install" \
- "or 'python setup.py --help' for more information".
+ @echo "Build process finished, run 'pip install .' to install" \
+ "or 'pip install dist/*.whl' for a specific wheel." \
+ "Use 'uv pip install .' if using uv."
clean:
- -python setup.py clean --all
+ -rm -rf build dist *.egg-info
-rm -f bin/offlineimapc 2>/dev/null
-find . -name '*.pyc' -exec rm -f {} \;
-find . -name '*.pygc' -exec rm -f {} \;
@@ -50,7 +52,7 @@ websitedoc:
targz: ../$(TARGZ)
../$(TARGZ):
- cd .. && tar -zhcv --transform s,^offlineimap,offlineimap-v$(VERSION), -f $(TARGZ).tar.gz --exclude '.*.swp' --exclude '.*.swo' --exclude '*.pyc' --exclude '__pycache__' offlineimap/{bin,Changelog.md,Changelog.maint.md,contrib,CONTRIBUTING.rst,COPYING,docs,MAINTAINERS.rst,Makefile,MANIFEST.in,offlineimap,offlineimap.conf,offlineimap.conf.minimal,offlineimap.py,README.md,requirements.txt,scripts,setup.cfg,setup.py,snapcraft.yaml,test,tests,TODO.rst}
+ cd .. && tar -zhcv --transform s,^$(DIRNAME),offlineimap-v$(VERSION), -f $(TARGZ).tar.gz --exclude '.*.swp' --exclude '.*.swo' --exclude '*.pyc' --exclude '__pycache__' $(DIRNAME)/{bin,Changelog.md,Changelog.maint.md,contrib,CONTRIBUTING.rst,COPYING,docs,MAINTAINERS.rst,Makefile,MANIFEST.in,offlineimap,offlineimap.conf,offlineimap.conf.minimal,offlineimap.py,pyproject.toml,README.md,requirements.txt,scripts,setup.cfg,snapcraft.yaml,test,tests,TODO.rst}
rpm: targz
cd .. && sudo rpmbuild -ta $(TARGZ)
diff --git a/contrib/release.sh b/contrib/release.sh
index 22af279..c915c3a 100755
--- a/contrib/release.sh
+++ b/contrib/release.sh
@@ -472,7 +472,7 @@ Make your checks and push the changes for both offlineimap and the website.
Announce template stands in '$TMP_ANNOUNCE'.
Command samples to do manually:
- git push <remote> master next $new_version
-- python setup.py sdist && twine upload dist/* && rm -rf dist MANIFEST
+- python -m build && twine upload dist/* && rm -rf dist
- cd website
- git checkout master
- git merge $branch_name
--
2.54.0
More information about the OfflineIMAP-project
mailing list