##// END OF EJS Templates
manifest: delay import of `typing.ByteString` for py 3.14 support (issue6940)...
manifest: delay import of `typing.ByteString` for py 3.14 support (issue6940) Since Python 2.7 and 3.5, `typing.ByteString` was defined as an alias for `bytes | bytearray | memoryview`, and `bytes` was also accepted as a shorthand for this, so we have `bytes` sprinkled all over the codebase. But then PEP-688 reversed all of that by deprecating `typing.ByteString` and its successor `collections.abc.ByteString` in Python 3.12 (as well as the `bytes` shorthand)[1], and removing it completely in Python 3.14. That leaves us with a couple of problems, namely defining something useful that spans py3.8-py3.13 and keeps pytype happy, and finding all of the instances where `bytes` doesn't really mean `bytes`. The current successor to all of this is `collections.abc.Buffer` in Python 3.12 (or `typing_extensions.Buffer` in previous versions). However, the current CI does type checking using Python 3.11 (so the former is not avaiable), and pytype has issues with importing `typing_extensions.Buffer`[2]. The good news is we don't need to deal with this mess immediately, since the type annotation evaluation is delayed to the type checking phase, and we're making no effort at supporting it in all supported versions of Python. So by delaying the import of this particular symbol, we can still use it for type checking purposes, but can start assessing Python 3.14 problems without doing a lot of extra work. Putting this on stable will allow people interested in 3.14 to work on it 4-5 extra months earlier (and apparently there's some interest). [1] https://peps.python.org/pep-0688/#no-special-meaning-for-bytes [2] https://github.com/google/pytype/issues/1772

File last commit:

r53159:af88f2b9 stable
r53224:0851d94b stable
Show More
Makefile
150 lines | 4.4 KiB | text/x-makefile | MakefileLexer
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 $(eval HGROOT := $(shell cd ../..; pwd))
Gregory Szorc
packaging: dynamically define make targets...
r38478 DEBIAN_CODENAMES := \
stretch \
av6
packaging: add Bullseye, remove Jessie...
r43077 buster \
bullseye
Gregory Szorc
packaging: dynamically define make targets...
r38478
UBUNTU_CODENAMES := \
xenial \
bionic \
av6
packaging: add Cosmic and Disco, remove Trusty and Artful...
r43076 cosmic \
Matt Harbison
packaging: drop Disco (19.04) and add Focal (20.04)...
r46582 focal
Gregory Szorc
packaging: dynamically define make targets...
r38478
Mads Kiilerich
packaging: update built-in Fedora support to Fedora 31...
r43678 FEDORA_RELEASE := 31
Gregory Szorc
packaging: dynamically define make targets...
r38478
Mathias De Mare
contrib: refer to RHEL and derivatives instead of CentOS specifically...
r49613 RHEL_RELEASES := \
Mathias De Mare
packaging: add support for CentOS 8...
r43723 7 \
Mathias De Mare
contrib: add support for rhel9
r50314 8 \
9
Gregory Szorc
packaging: dynamically define make targets...
r38478
Mathias De Mare
contrib: refer to RHEL and derivatives instead of CentOS specifically...
r49613 # Build a Python for these RHEL (and derivatives) releases.
RHEL_WITH_PYTHON_RELEASES :=
RHEL_WITH_NONVERSIONED_PYTHON :=
RHEL_WITH_36_DOCUTILS := 7
Gregory Szorc
packaging: dynamically define make targets...
r38478
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 help:
@echo 'Packaging Make Targets'
@echo ''
Mathias De Mare
contrib: refer to RHEL and derivatives instead of CentOS specifically...
r49613 @echo 'docker-rhel{$(strip $(RHEL_RELEASES))}'
@echo ' Build an RPM for a specific RHEL/derivative version using Docker.'
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 @echo ''
Gregory Szorc
packaging: dynamically define make targets...
r38478 @echo 'docker-debian-{$(strip $(DEBIAN_CODENAMES))}'
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 @echo ' Build Debian packages specific to a Debian distro using Docker.'
@echo ''
Mads Kiilerich
packaging: refactor "fedora29" target to a single more generic "fedora" target...
r43677 @echo 'docker-fedora'
@echo ' Build an RPM for a Fedora $(FEDORA_RELEASE) using Docker.'
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 @echo ''
Gregory Szorc
packaging: dynamically define make targets...
r38478 @echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}'
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 @echo ' Build Debian package specific to an Ubuntu distro using Docker.'
@echo ''
Gregory Szorc
packaging: dynamically define make targets...
r38478 @echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}-ppa'
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 @echo ' Build a source-only Debian package specific to an Ubuntu distro'
@echo ' using Docker.'
@echo ''
@echo 'linux-wheels'
@echo ' Build Linux manylinux wheels using Docker.'
@echo ''
wheel: add a target for amdx86_64-musl wheels...
r53157 @echo 'linux-wheels-{x86_64, i686}{,-musl}'
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 @echo ' Build Linux manylinux wheels for a specific architecture using Docker'
wheel: add a target for amdx86_64-musl wheels...
r53157 @echo ' The -musl variants is suitable for system using "musl" instead of "glibc",
@echo ' for example: Alpine linux.'
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 @echo ''
@echo 'deb'
@echo ' Build a Debian package locally targeting the current system'
@echo ''
@echo 'ppa'
@echo ' Build a Debian source package locally targeting the current system'
@echo ''
Mathias De Mare
contrib: refer to RHEL and derivatives instead of CentOS specifically...
r49613 @echo 'rhel{$(strip $(RHEL_RELEASES))}'
@echo ' Build an RPM for a specific RHEL/derivative version locally'
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 @echo ''
Mads Kiilerich
packaging: refactor "fedora29" target to a single more generic "fedora" target...
r43677 @echo 'fedora'
@echo ' Build an RPM for Fedora $(FEDORA_RELEASE) locally'
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
.PHONY: help
.PHONY: deb
deb:
./builddeb
.PHONY: ppa
ppa:
./builddeb --source-only
Gregory Szorc
packaging: dynamically define make targets...
r38478 # Debian targets.
define debian_targets =
.PHONY: docker-debian-$(1)
docker-debian-$(1):
./dockerdeb debian $(1)
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
Gregory Szorc
packaging: dynamically define make targets...
r38478 endef
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
Gregory Szorc
packaging: dynamically define make targets...
r38478 $(foreach codename,$(DEBIAN_CODENAMES),$(eval $(call debian_targets,$(codename))))
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
Gregory Szorc
packaging: dynamically define make targets...
r38478 # Ubuntu targets.
define ubuntu_targets =
.PHONY: docker-ubuntu-$(1)
docker-ubuntu-$(1):
./dockerdeb ubuntu $(1)
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
Gregory Szorc
packaging: dynamically define make targets...
r38478 .PHONY: docker-ubuntu-$(1)-ppa
docker-ubuntu-$(1)-ppa:
./dockerdeb ubuntu $(1) --source-only
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
Gregory Szorc
packaging: dynamically define make targets...
r38478 endef
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
Gregory Szorc
packaging: dynamically define make targets...
r38478 $(foreach codename,$(UBUNTU_CODENAMES),$(eval $(call ubuntu_targets,$(codename))))
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
Gregory Szorc
packaging: dynamically define make targets...
r38478 # Fedora targets.
Mads Kiilerich
packaging: refactor "fedora29" target to a single more generic "fedora" target...
r43677 .PHONY: fedora
fedora:
mkdir -p $(HGROOT)/packages/fedora$(FEDORA_RELEASE)
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 ./buildrpm
Mads Kiilerich
packaging: refactor "fedora29" target to a single more generic "fedora" target...
r43677 cp $(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $(HGROOT)/packages/fedora$(FEDORA_RELEASE)
cp $(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $(HGROOT)/packages/fedora$(FEDORA_RELEASE)
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 rm -rf $(HGROOT)/rpmbuild
Mads Kiilerich
packaging: refactor "fedora29" target to a single more generic "fedora" target...
r43677 .PHONY: docker-fedora
docker-fedora:
./dockerrpm fedora$(FEDORA_RELEASE)
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
Mathias De Mare
contrib: refer to RHEL and derivatives instead of CentOS specifically...
r49613 # RHEL targets.
define rhel_targets
.PHONY: rhel$(1)
rhel$(1):
mkdir -p $$(HGROOT)/packages/rhel$(1)
./buildrpm $$(if $$(filter $(1),$$(RHEL_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(RHEL_WITH_NONVERSIONED_PYTHON)),--python python,))$$(if $$(filter $(1),$$(RHEL_WITH_36_DOCUTILS)), --docutilspackage python36-docutils,)
cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/rhel$(1)
cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/rhel$(1)
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
Mathias De Mare
contrib: refer to RHEL and derivatives instead of CentOS specifically...
r49613 .PHONY: docker-rhel$(1)
docker-rhel$(1):
./dockerrpm rhel$(1) $$(if $$(filter $(1),$$(RHEL_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(RHEL_WITH_NONVERSIONED_PYTHON)),--python python,))$$(if $$(filter $(1),$$(RHEL_WITH_36_DOCUTILS)), --docutilspackage python36-docutils,)
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
Gregory Szorc
packaging: dynamically define make targets...
r38478 endef
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
Mathias De Mare
contrib: refer to RHEL and derivatives instead of CentOS specifically...
r49613 $(foreach release,$(RHEL_RELEASES),$(eval $(call rhel_targets,$(release))))
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
.PHONY: linux-wheels
wheel: reintroduce the building of i686 wheel...
r53159 linux-wheels: linux-wheels-x86_64 linux-wheels-x86_64-musl linux-wheels-i686 linux-wheels-i686-musl
packaging: factor the linux-wheels-x86_64 a bit...
r53156
img_reg="registry.heptapod.net/mercurial/ci-images"
img_tag="v3.0"
whl_sh="/src/contrib/packaging/build-linux-wheels.sh"
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 .PHONY: linux-wheels-x86_64
linux-wheels-x86_64:
packaging: factor the linux-wheels-x86_64 a bit...
r53156 docker run --rm -ti -v `pwd`/../..:/src $(img_reg)/core-wheel-x86_64-c:$(img_tag) $(whl_sh)
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034
wheel: add a target for amdx86_64-musl wheels...
r53157 .PHONY: linux-wheels-x86_64-musl
linux-wheels-x86_64-musl:
docker run --rm -ti -v `pwd`/../..:/src $(img_reg)/core-wheel-x86_64-musl-c:$(img_tag) $(whl_sh)
Gregory Szorc
packaging: move most packaging targets to own Makefile...
r38034 .PHONY: linux-wheels-i686
linux-wheels-i686:
wheel: reintroduce the building of i686 wheel...
r53159 docker run --rm -ti -v `pwd`/../..:/src $(img_reg)/core-wheel-i686-c:$(img_tag) $(whl_sh)
.PHONY: linux-wheels-i686-musl
linux-wheels-i686-musl:
docker run --rm -ti -v `pwd`/../..:/src $(img_reg)/core-wheel-i686-musl-c:$(img_tag) $(whl_sh)