diff --git a/Dockerfile b/Dockerfile index 5b4ee1f7..b6afcf27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,13 +14,14 @@ WORKDIR /app-src #RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y krb5-user -y && rm -rf /var/lib/apt/lists/* # Get latest pip and dependencies +ENV PIP_ROOT_USER_ACTION=ignore RUN /usr/local/bin/python3 -m pip install --upgrade pip && pip install -r requirements.txt # Copy in rest of the code after deps are in place 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 9f0012b9..987c9b24 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,8 @@ # Warning: VERSION, ABBREV and TARGZ are used in docs/build-uploads.sh. VERSION=$(shell ./offlineimap.py --version) -ABBREV=$(shell git log --format='%h' HEAD~1..) +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 22af2799..c915c3a9 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 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 diff --git a/docs/build-uploads.sh b/docs/build-uploads.sh index 3bef5418..45d15a82 100755 --- a/docs/build-uploads.sh +++ b/docs/build-uploads.sh @@ -19,7 +19,7 @@ make targz >/dev/null # Defined in the root Makefile. version="$(./offlineimap.py --version)" -abbrev="$(git log --format='%h' HEAD~1..)" +abbrev="$(git rev-parse --short HEAD)" targz="../offlineimap-v${version}-${abbrev}.tar.gz" filename="offlineimap-v${version}.tar.gz"