From 593813e5d937016a003b36d4ff4cf94665a4c03e Mon Sep 17 00:00:00 2001 From: irl Date: Mon, 11 Nov 2024 12:36:52 +0000 Subject: [PATCH] initial EncryptedClientHello support in ssl module --- .github/workflows/packages.yml | 82 ++ Doc/library/ssl.rst | 121 ++- Lib/ssl.py | 61 +- Modules/_ssl.c | 208 ++++ Modules/clinic/_ssl.c.h | 142 ++- configure | 44 + configure.ac | 16 + debian/2to3.1 | 41 + debian/2to3.py | 5 + debian/README.Debian | 17 + debian/changelog | 1460 ++++++++++++++++++++++++++ debian/chunk.xsl | 16 + debian/compat | 1 + debian/control | 272 +++++ debian/control.in | 272 +++++ debian/copyright | 319 ++++++ debian/debian_defaults | 12 + debian/html.xsl | 11 + debian/idle.1 | 104 ++ debian/idle.desktop | 11 + debian/idle.lintian-overrides | 1 + debian/idle.py | 5 + debian/py3versions | 6 + debian/py3versions.1 | 47 + debian/py3versions.py | 334 ++++++ debian/python-policy.dbk | 1163 ++++++++++++++++++++ debian/python.doc-base.python-policy | 19 + debian/python.mk | 46 + debian/python3-minimal.manpages | 2 + debian/python3-minimal.postinst.in | 8 + debian/python3-minimal.prerm | 7 + debian/python3.desktop | 6 + debian/python3.lintian-overrides | 2 + debian/python3.postinst.in | 50 + debian/python3.postrm.in | 9 + debian/python3.preinst.in | 30 + debian/python3.prerm | 8 + debian/rules | 424 ++++++++ debian/source.lintian-overrides | 7 + debian/source/format | 1 + debian/valgrind-python.supp | 492 +++++++++ debian/watch | 2 + pyconfig.h.in | 13 + 43 files changed, 5885 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/packages.yml create mode 100644 debian/2to3.1 create mode 100755 debian/2to3.py create mode 100644 debian/README.Debian create mode 100644 debian/changelog create mode 100644 debian/chunk.xsl create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/control.in create mode 100644 debian/copyright create mode 100644 debian/debian_defaults create mode 100644 debian/html.xsl create mode 100644 debian/idle.1 create mode 100644 debian/idle.desktop create mode 100644 debian/idle.lintian-overrides create mode 100755 debian/idle.py create mode 100755 debian/py3versions create mode 100644 debian/py3versions.1 create mode 100644 debian/py3versions.py create mode 100644 debian/python-policy.dbk create mode 100644 debian/python.doc-base.python-policy create mode 100644 debian/python.mk create mode 100644 debian/python3-minimal.manpages create mode 100644 debian/python3-minimal.postinst.in create mode 100644 debian/python3-minimal.prerm create mode 100644 debian/python3.desktop create mode 100644 debian/python3.lintian-overrides create mode 100644 debian/python3.postinst.in create mode 100644 debian/python3.postrm.in create mode 100644 debian/python3.preinst.in create mode 100644 debian/python3.prerm create mode 100755 debian/rules create mode 100644 debian/source.lintian-overrides create mode 100644 debian/source/format create mode 100644 debian/valgrind-python.supp create mode 100644 debian/watch diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml new file mode 100644 index 000000000000000..802a9d2feef711c --- /dev/null +++ b/.github/workflows/packages.yml @@ -0,0 +1,82 @@ +name: builder + +on: + workflow_dispatch: + push: + schedule: + - cron: '30 5 * * *' + +jobs: + packages: + runs-on: ubuntu-24.04 + steps: + - name: Check out the repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: merge upstream + run: | + git remote add upstream https://github.com/python/cpython.git + git fetch upstream + git -c user.name=Github -c user.email=none merge upstream/main + + - name: Cache ccache + uses: actions/cache@v4 + with: + path: /home/runner/.cache/ccache + key: ccache + + - name: Prepare build environment + run: | + sudo DEBIAN_FRONTEND=noninteractive apt update && sudo DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends sbuild mmdebstrap debian-archive-keyring ccache uidmap + + mkdir -p "$HOME/.cache/sbuild" + mmdebstrap --variant=buildd --include=apt,ccache,ca-certificates \ + --keyring=/usr/share/keyrings/debian-archive-keyring.gpg \ + --customize-hook='chroot "$1" update-ccache-symlinks' \ + testing "$HOME/.cache/sbuild/testing-amd64.tar" + + ccache --zero-stats --max-size=10.0G + chmod a+X "$HOME" "$HOME/.cache" + chmod -R a+rwX "$HOME/.cache/ccache" + + cat << "EOF" > "$HOME/.sbuildrc" + $build_environment = { "CCACHE_DIR" => "/build/ccache" }; + $path = "/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"; + $build_path = "/build/package/"; + $dsc_dir = "package"; + $unshare_bind_mounts = [ { directory => "$HOME/.cache/ccache", mountpoint => "/build/ccache" } ]; + $verbose = 1; + EOF + mkdir "$HOME/apt_repo" + +# - name: Run sbuild +# run: | + sed -i "1 s/([^)]*)/($(git describe --tags | sed 's/^[^0-9]*//;s/-/./g;s/_/./g')-$(date -u '+%Y%m%d.%H%M%S%N'))/" debian/changelog + sbuild -d testing --chroot-mode=unshare --no-clean-source --no-run-lintian \ + --extra-repository="deb [trusted=yes] https://github.com/defo-project/openssl/raw/packages/ ./" \ + --dpkg-source-opts="-Zgzip -z1 --format=1.0 -sn" --build-dir="$HOME/apt_repo" + cd "$HOME/apt_repo" + apt-ftparchive packages . > Packages + apt-ftparchive release . > Release + +# - name: Test packages +# run: | +# mmdebstrap --verbose --chrooted-customize-hook="curl --ech true --doh-url 'https://1.1.1.1/dns-query' 'https://defo.ie/ech-check.php' | grep 'SSL_ECH_STATUS: success'" \ +# --variant=essential --include=ca-certificates,curl testing /dev/null \ +# "deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian testing main" \ +# "deb [trusted=yes] https://github.com/defo-project/openssl/raw/packages/ /" \ +# "deb [trusted=yes] copy:/$HOME/apt_repo /" + + - name: Upload apt repository + run: | + cd "$HOME/apt_repo" + BRANCH=packages + REPOSITORY="$(printf "%s" "$GITHUB_REPOSITORY" | tr / _)" + echo "echo \"deb [trusted=yes] $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/raw/$BRANCH/ /\" | sudo tee /etc/apt/sources.list.d/$REPOSITORY.list" >> README.md + git init -b "$BRANCH" + git remote add origin "$(echo "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git" | sed "s#https://#https://x-access-token:${{ secrets.GITHUB_TOKEN }}@#")" + git add . + git -c user.name=Github -c user.email=none commit --message="Generated with $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" + git push --force origin "$BRANCH" diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index b7fb1fc07d199f4..992f89a7bfd7e3a 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -214,7 +214,6 @@ purposes. The context now uses :data:`VERIFY_X509_PARTIAL_CHAIN` and :data:`VERIFY_X509_STRICT` in its default verify flags. - Exceptions ^^^^^^^^^^ @@ -990,6 +989,13 @@ Constants .. versionadded:: 3.6 +.. class:: ECHStatus + + `enum.IntEnum` collection of Encrypted Client Hello (ECH) statuses + returned by :meth:`SSLSocket.get_ech_status`. + + .. versionadded:: TODO XXX + .. data:: Purpose.SERVER_AUTH Option for :func:`create_default_context` and @@ -1294,6 +1300,22 @@ SSL sockets also have the following additional methods and attributes: .. versionadded:: 3.3 +.. method:: SSLSocket.get_ech_retry_config() + + When the status returned by `SSLSocket.get_ech_status` after completion of the + handshake is :data:`ECHStatus.ECH_STATUS_GREASE_ECH`, this method returns the + configuration value provided by the server to be used for a new connection using + ECH. + + .. versionadded:: TODO XXX + +.. method:: SSLSocket.get_ech_status() + + Gets the status of Encrypted Client Hello (ECH) processing. Returns an + :class:`ECHStatus` instance. + + .. versionadded:: TODO XXX + .. method:: SSLSocket.selected_alpn_protocol() Return the protocol that was selected during the TLS handshake. If @@ -1366,6 +1388,15 @@ SSL sockets also have the following additional methods and attributes: .. versionadded:: 3.2 +.. attribute:: SSLSocket.outer_server_hostname + + Hostname of the server name used in the outer ClientHello when Encrypted Client + Hello (ECH) is used: :class:`str` type, or ``None`` for server-side socket or + if the outer server name was not specified in the constructor or the ECH + configuration. + + .. versionadded:: TODO XXX + .. attribute:: SSLSocket.server_side A boolean which is ``True`` for server-side sockets and ``False`` for @@ -1667,6 +1698,24 @@ to speed up repeated connections from the same clients. .. versionadded:: 3.5 +.. method:: SSLContext.set_ech_config(ech_config) + + Sets an Encrypted Client Hello (ECH) configuration, which may be discovered from + an HTTPS resource record in DNS or from :meth:`SSLSocket.get_ech_retry_config`. + Multiple calls to this functions will accumulate the set of values available for + a connection. + + If the input value provided contains no suitable value (e.g. if it only contains + ECH configuration versions that are not supported), an :class:`SSLError` will be + raised. + + The ech_config parameter should be a bytes-like object containing the raw ECH + configuration. + + This method will raise :exc:`NotImplementedError` if :data:`HAS_ECH` is ``False``. + + .. versionadded:: TODO XXX + .. method:: SSLContext.set_npn_protocols(protocols) Specify which protocols the socket should advertise during the SSL/TLS @@ -1686,6 +1735,28 @@ to speed up repeated connections from the same clients. NPN has been superseded by ALPN +.. method:: SSLContext.set_outer_alpn_protocols(protocols) + + Specify which protocols the socket should advertise during the TLS + handshake in the outer ClientHello when ECH is used. The `protocols` + argument accepts the same values as for + :meth:`~SSLContext.set_alpn_protocols`. + + This method will raise :exc:`NotImplementedError` if :data:`HAS_ECH` is + ``False``. + + .. versionadded:: TODO XXX + +.. method:: SSLContext.set_outer_server_hostname(server_hostname) + + Specify which hostname the socket should advertise during the TLS + handshake in the outer ClientHello when ECH is used. + + This method will raise :exc:`NotImplementedError` if :data:`HAS_ECH` is + ``False``. + + .. versionadded:: TODO XXX + .. attribute:: SSLContext.sni_callback Register a callback function that will be called after the TLS Client Hello @@ -2581,6 +2652,8 @@ provided. - :meth:`~SSLSocket.verify_client_post_handshake` - :meth:`~SSLSocket.unwrap` - :meth:`~SSLSocket.get_channel_binding` + - :meth:`~SSLSocket.get_ech_retry_config` + - :meth:`~SSLSocket.get_ech_status` - :meth:`~SSLSocket.version` When compared to :class:`SSLSocket`, this object lacks the following @@ -2800,6 +2873,52 @@ of TLS/SSL. Some new TLS 1.3 features are not yet available. - TLS 1.3 features like early data, deferred TLS client cert request, signature algorithm configuration, and rekeying are not supported yet. +Encrypted Client Hello +^^^^^^^^^^^^^^^^^^^^^^ + +.. versionadded:: TODO XXX + +Encrypted Client Hello (ECH) allows for encrypting values that have previously only been +included unencrypted in the ClientHello records when establishing a TLS connection. To use +ECH it is necessary to provide configuration values that contain a version, algorithm +parameters, the public key to use for HPKE encryption and the "public_name" that is by +default used for the unencrypted (outer) SNI when ECH is attempted. These configuration +values may be discovered through DNS or through the "retry config" mechanism. + +The following example assumes that you have discovered a set of ECH configuration values +from DNS, or `ech_configs` may be an empty list to rely on the "retry config" mechanism:: + + import socket + import ssl + + + def connect_with_tls_ech(hostname: str, ech_configs: List[str], + use_retry_config: bool=True) -> ssl.SSLSocket: + context = ssl.create_default_context() + for ech_config in ech_configs: + context.set_ech_config(ech_config) + with socket.create_connection((hostname, 443)) as sock: + with context.wrap_socket(sock, server_hostname=hostname) as ssock: + if (ssock.get_ech_status == ECHStatus.ECH_STATUS_GREASE_ECH + and use_retry_config): + return connect_with_ech(hostname, [ssock.get_ech_retry_config()], + False) + return ssock + + hostname = "www.python.org" + ech_configs = [] # Replace with a call to a function to lookup + # ECH configurations in DNS + + ssock = connect_with_tls_ech(hostname, ech_configs) + +The following classes, methods, and attributes will be useful for using ECH: + + - :class:`ECHStatus` + - :meth:`SSLContext.set_ech_config` + - :meth:`SSLContext.set_outer_alpn_protocols` + - :meth:`SSLContext.set_outer_server_hostname` + - :meth:`SSLSocket.get_ech_status` + - :meth:`SSLSocket.get_ech_retry_config` .. seealso:: diff --git a/Lib/ssl.py b/Lib/ssl.py index c8703b046cfd4b3..9ad0a614bc6bc4a 100644 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -150,6 +150,11 @@ lambda name: name.startswith('CERT_'), source=_ssl) +_IntEnum._convert_( + 'ECHStatus', __name__, + lambda name: name.startswith('ECH_STATUS_'), + source=_ssl) + PROTOCOL_SSLv23 = _SSLMethod.PROTOCOL_SSLv23 = _SSLMethod.PROTOCOL_TLS _PROTOCOL_NAMES = {value: name for name, value in _SSLMethod.__members__.items()} @@ -459,7 +464,7 @@ def wrap_socket(self, sock, server_side=False, suppress_ragged_eofs=suppress_ragged_eofs, server_hostname=server_hostname, context=self, - session=session + session=session, ) def wrap_bio(self, incoming, outgoing, server_side=False, @@ -502,16 +507,13 @@ def shim_cb(sslobj, servername, sslctx): self.sni_callback = shim_cb def set_alpn_protocols(self, alpn_protocols): - protos = bytearray() - for protocol in alpn_protocols: - b = bytes(protocol, 'ascii') - if len(b) == 0 or len(b) > 255: - raise SSLError('ALPN protocols must be 1 to 255 in length') - protos.append(len(b)) - protos.extend(b) - + protos = encode_alpn_protocol_list(alpn_protocols) self._set_alpn_protocols(protos) + def set_outer_alpn_protocols(self, alpn_protocols): + protos = encode_alpn_protocol_list(alpn_protocols) + self._set_outer_alpn_protocols(protos) + def _load_windows_store_certs(self, storename, purpose): try: for cert, encoding, trust in enum_certificates(storename): @@ -831,6 +833,14 @@ def context(self): def context(self, ctx): self._sslobj.context = ctx + @property + def outer_server_hostname(self) -> str: + """The server name used in the outer ClientHello.""" + if self._sslobj: + return self._sslobj.get_ech_status()[2] + else: + raise ValueError("No SSL wrapper around " + str(self)) + @property def session(self): """The SSLSession for client socket.""" @@ -968,6 +978,9 @@ def version(self): def verify_client_post_handshake(self): return self._sslobj.verify_client_post_handshake() + def get_ech_status(self): + return ECHStatus(self._sslobj.get_ech_status()[0]) + def _sslcopydoc(func): """Copy docstring from SSLObject to SSLSocket""" @@ -990,13 +1003,16 @@ def __init__(self, *args, **kwargs): @classmethod def _create(cls, sock, server_side=False, do_handshake_on_connect=True, suppress_ragged_eofs=True, server_hostname=None, - context=None, session=None): + context=None, session=None, outer_server_hostname=None): if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM: raise NotImplementedError("only stream sockets are supported") if server_side: if server_hostname: raise ValueError("server_hostname can only be specified " "in client mode") + if outer_server_hostname: + raise ValueError("outer_server_hostname can only be specified " + "in client mode") if session is not None: raise ValueError("session can only be specified in " "client mode") @@ -1092,6 +1108,14 @@ def context(self, ctx): self._context = ctx self._sslobj.context = ctx + @property + def outer_server_hostname(self) -> str: + """The server name used in the outer ClientHello.""" + if self._sslobj: + return self._sslobj.get_ech_status()[2] + else: + raise ValueError("No SSL wrapper around " + str(self)) + @property @_sslcopydoc def session(self): @@ -1358,6 +1382,13 @@ def verify_client_post_handshake(self): else: raise ValueError("No SSL wrapper around " + str(self)) + + def get_ech_status(self): + if self._sslobj: + return ECHStatus(self._sslobj.get_ech_status()[0]) + else: + raise ValueError("No SSL wrapper around " + str(self)) + def _real_close(self): self._sslobj = None super()._real_close() @@ -1527,3 +1558,13 @@ def get_server_certificate(addr, ssl_version=PROTOCOL_TLS_CLIENT, def get_protocol_name(protocol_code): return _PROTOCOL_NAMES.get(protocol_code, '') + +def encode_alpn_protocol_list(alpn_protocols): + protos = bytearray() + for protocol in alpn_protocols: + b = bytes(protocol, 'ascii') + if len(b) == 0 or len(b) > 255: + raise SSLError('ALPN protocols must be 1 to 255 in length') + protos.append(len(b)) + protos.extend(b) + return protos \ No newline at end of file diff --git a/Modules/_ssl.c b/Modules/_ssl.c index b6b5ebf094c938a..e2d5c54c0564d72 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -69,6 +69,10 @@ #include "openssl/bio.h" #include "openssl/dh.h" +#if __has_include("openssl/ech.h") +#include "openssl/ech.h" +#endif + #ifndef OPENSSL_THREADS # error "OPENSSL_THREADS is not defined, Python requires thread-safe OpenSSL" #endif @@ -2020,6 +2024,111 @@ cipher_to_dict(const SSL_CIPHER *cipher) ); } +/*[clinic input] +_ssl._SSLSocket.get_ech_status +[clinic start generated code]*/ + +static PyObject * +_ssl__SSLSocket_get_ech_status_impl(PySSLSocket *self) +/*[clinic end generated code: output=263bf7fc7888e2d6 input=4f68a05d59f39372]*/ +{ +#ifdef OPENSSL_ECH + char *inner_sni = NULL, *outer_sni = NULL; + + if (self->ssl == NULL) { + Py_RETURN_NONE; + } + + int status = SSL_ech_get_status(self->ssl, &inner_sni, &outer_sni); + PyObject *retval = PyTuple_New(3); + PyTuple_SetItem(retval, 0, PyLong_FromLong(status)); + + if (inner_sni != NULL) { + PyTuple_SetItem(retval, 1, PyUnicode_FromString(inner_sni)); + OPENSSL_free(inner_sni); + } else { + PyTuple_SetItem(retval, 1, Py_None); + Py_INCREF(Py_None); + } + + if (outer_sni != NULL) { + PyTuple_SetItem(retval, 2, PyUnicode_FromString(outer_sni)); + OPENSSL_free(outer_sni); + } else { + PyTuple_SetItem(retval, 2, Py_None); + Py_INCREF(Py_None); + } + + return retval; +#else + PyErr_SetString(PyExc_NotImplementedError, "OpenSSL does not have ECH support"); + return NULL; +#endif +} + +/*[clinic input] +_ssl._SSLSocket.get_ech_retry_config +[clinic start generated code]*/ + +static PyObject * +_ssl__SSLSocket_get_ech_retry_config_impl(PySSLSocket *self) +/*[clinic end generated code: output=967da2032df9a37a input=b9b3cee90aedc05d]*/ +{ +#ifdef OPENSSL_ECH + unsigned char *ec; + size_t eclen; + + if (self->ssl == NULL) { + Py_RETURN_NONE; + } + + SSL_ech_get_retry_config(self->ssl, &ec, &eclen); + + return PyBytes_FromStringAndSize((char *)ec, eclen); +#else + PyErr_SetString(PyExc_NotImplementedError, "OpenSSL does not have ECH support"); + return NULL; +#endif +} + +/*[clinic input] +_ssl._SSLSocket.set_outer_server_name + + outer_server_name: str + / +[clinic start generated code]*/ + +static PyObject * +_ssl__SSLSocket_set_outer_server_name_impl(PySSLSocket *self, + const char *outer_server_name) +/*[clinic end generated code: output=24e7c6b7b3c2ce84 input=5f68803fbe85a69c]*/ +{ +#ifdef OPENSSL_ECH + if (self->ssl == NULL) { + Py_RETURN_NONE; + } + + int result; + + if (outer_server_name != NULL) { + result = SSL_ech_set_outer_server_name(self->ssl, outer_server_name, 0); + } else { + /* Do not send an outer SNI */ + result = SSL_ech_set_outer_server_name(self->ssl, NULL, 1); + } + + if (result != 1) { + _setSSLError(get_state_sock(self), NULL, 0, __FILE__, __LINE__); + return NULL; + } + + Py_RETURN_NONE; +#else + PyErr_SetString(PyExc_NotImplementedError, "OpenSSL does not have ECH support"); + return NULL; +#endif +} + /*[clinic input] @critical_section _ssl._SSLSocket.shared_ciphers @@ -2961,6 +3070,9 @@ static PyMethodDef PySSLMethods[] = { _SSL__SSLSOCKET_COMPRESSION_METHODDEF _SSL__SSLSOCKET_SHUTDOWN_METHODDEF _SSL__SSLSOCKET_VERIFY_CLIENT_POST_HANDSHAKE_METHODDEF + _SSL__SSLSOCKET_GET_ECH_STATUS_METHODDEF + _SSL__SSLSOCKET_SET_OUTER_SERVER_NAME_METHODDEF + _SSL__SSLSOCKET_GET_ECH_RETRY_CONFIG_METHODDEF _SSL__SSLSOCKET_GET_UNVERIFIED_CHAIN_METHODDEF _SSL__SSLSOCKET_GET_VERIFIED_CHAIN_METHODDEF {NULL, NULL} @@ -3402,6 +3514,43 @@ _ssl__SSLContext__set_alpn_protocols_impl(PySSLContext *self, Py_RETURN_NONE; } +/*[clinic input] +@critical_section +_ssl._SSLContext._set_outer_alpn_protocols + protos: Py_buffer + / +[clinic start generated code]*/ + +static PyObject * +_ssl__SSLContext__set_outer_alpn_protocols_impl(PySSLContext *self, + Py_buffer *protos) +/*[clinic end generated code: output=823aea95e8dea835 input=b6ddf7d0791afd0e]*/ +{ +#ifdef OPENSSL_ECH + if ((size_t)protos->len > UINT_MAX) { + PyErr_Format(PyExc_OverflowError, + "protocols longer than %u bytes", UINT_MAX); + return NULL; + } + + PyMem_Free(self->alpn_protocols); + self->alpn_protocols = PyMem_Malloc(protos->len); + if (!self->alpn_protocols) { + return PyErr_NoMemory(); + } + memcpy(self->alpn_protocols, protos->buf, protos->len); + self->alpn_protocols_len = (unsigned int)protos->len; + if (SSL_CTX_ech_set_outer_alpn_protos(self->ctx, self->alpn_protocols, self->alpn_protocols_len)) { + return PyErr_NoMemory(); + } + + Py_RETURN_NONE; +#else + PyErr_SetString(PyExc_NotImplementedError, "OpenSSL does not have ECH support"); + return NULL; +#endif +} + /*[clinic input] @critical_section @getter @@ -4517,6 +4666,36 @@ _ssl__SSLContext_set_default_verify_paths_impl(PySSLContext *self) Py_RETURN_NONE; } +/*[clinic input] +_ssl._SSLContext.set_ech_config + + ech_config: Py_buffer + / + +Set the ECH configuration on the SSL context. + +The echconfig parameter should be a bytes-like object containing the raw ECH configuration. +[clinic start generated code]*/ + +static PyObject * +_ssl__SSLContext_set_ech_config_impl(PySSLContext *self, + Py_buffer *ech_config) +/*[clinic end generated code: output=cea53188b338cf80 input=09f9a38c5aaef091]*/ +{ +#ifdef OPENSSL_ECH + if (!SSL_CTX_ech_set1_echconfig(self->ctx, ech_config->buf, ech_config->len)) { + _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__); + return NULL; + } + + PyBuffer_Release(ech_config); + Py_RETURN_NONE; +#else + PyErr_SetString(PyExc_NotImplementedError, "OpenSSL does not have ECH support"); + return NULL; +#endif +} + /*[clinic input] @critical_section _ssl._SSLContext.set_ecdh_curve @@ -5153,6 +5332,8 @@ static struct PyMethodDef context_methods[] = { _SSL__SSLCONTEXT_SESSION_STATS_METHODDEF _SSL__SSLCONTEXT_SET_DEFAULT_VERIFY_PATHS_METHODDEF _SSL__SSLCONTEXT_SET_ECDH_CURVE_METHODDEF + _SSL__SSLCONTEXT_SET_ECH_CONFIG_METHODDEF + _SSL__SSLCONTEXT__SET_OUTER_ALPN_PROTOCOLS_METHODDEF _SSL__SSLCONTEXT_CERT_STORE_STATS_METHODDEF _SSL__SSLCONTEXT_GET_CA_CERTS_METHODDEF _SSL__SSLCONTEXT_GET_CIPHERS_METHODDEF @@ -6307,6 +6488,20 @@ sslmodule_init_constants(PyObject *m) ADD_INT_CONST("VERIFY_X509_PARTIAL_CHAIN", X509_V_FLAG_PARTIAL_CHAIN); #endif +#ifdef OPENSSL_ECH + ADD_INT_CONST("ECH_STATUS_BACKEND", SSL_ECH_STATUS_BACKEND); + ADD_INT_CONST("ECH_STATUS_GREASE_ECH", SSL_ECH_STATUS_GREASE_ECH); + ADD_INT_CONST("ECH_STATUS_GREASE", SSL_ECH_STATUS_GREASE); + ADD_INT_CONST("ECH_STATUS_SUCCESS", SSL_ECH_STATUS_SUCCESS); + ADD_INT_CONST("ECH_STATUS_FAILED", SSL_ECH_STATUS_FAILED); + ADD_INT_CONST("ECH_STATUS_BAD_CALL", SSL_ECH_STATUS_BAD_CALL); + ADD_INT_CONST("ECH_STATUS_NOT_TRIED", SSL_ECH_STATUS_NOT_TRIED); + ADD_INT_CONST("ECH_STATUS_BAD_NAME", SSL_ECH_STATUS_BAD_NAME); + ADD_INT_CONST("ECH_STATUS_NOT_CONFIGURED", SSL_ECH_STATUS_NOT_CONFIGURED); + ADD_INT_CONST("ECH_STATUS_FAILED_ECH", SSL_ECH_STATUS_FAILED_ECH); + ADD_INT_CONST("ECH_STATUS_FAILED_ECH_BAD_NAME", SSL_ECH_STATUS_FAILED_ECH_BAD_NAME); +#endif + /* Alert Descriptions from ssl.h */ /* note RESERVED constants no longer intended for use have been removed */ /* http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6 */ @@ -6390,6 +6585,13 @@ sslmodule_init_constants(PyObject *m) ADD_OPTION("OP_NO_TICKET", SSL_OP_NO_TICKET); ADD_OPTION("OP_LEGACY_SERVER_CONNECT", SSL_OP_LEGACY_SERVER_CONNECT); +#ifdef OPENSSL_ECH + ADD_OPTION("OP_ECH_GREASE", SSL_OP_ECH_GREASE); + ADD_OPTION("OP_ECH_TRIALDECRYPT", SSL_OP_ECH_TRIALDECRYPT); + ADD_OPTION("OP_ECH_IGNORE_CID", SSL_OP_ECH_IGNORE_CID); + ADD_OPTION("OP_ECH_GREASE_RETRY_CONFIG", SSL_OP_ECH_GREASE_RETRY_CONFIG); + ADD_OPTION("OP_ECH_SPECIFIC_PADDING", SSL_OP_ECH_SPECIFIC_PADDING); +#endif #ifdef SSL_OP_SINGLE_ECDH_USE ADD_OPTION("OP_SINGLE_ECDH_USE", SSL_OP_SINGLE_ECDH_USE); #endif @@ -6505,6 +6707,12 @@ sslmodule_init_constants(PyObject *m) addbool(m, "HAS_PSK", 1); #endif +#ifdef OPENSSL_NO_ECH + addbool(m, "HAS_ECH", 0); +#else + addbool(m, "HAS_ECH", 1); +#endif + #undef addbool #undef ADD_INT_CONST diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h index 582eef16c132446..55a610c98087bb6 100644 --- a/Modules/clinic/_ssl.c.h +++ b/Modules/clinic/_ssl.c.h @@ -149,6 +149,77 @@ _ssl__SSLSocket_get_unverified_chain(PySSLSocket *self, PyObject *Py_UNUSED(igno return return_value; } +PyDoc_STRVAR(_ssl__SSLSocket_get_ech_status__doc__, +"get_ech_status($self, /)\n" +"--\n" +"\n"); + +#define _SSL__SSLSOCKET_GET_ECH_STATUS_METHODDEF \ + {"get_ech_status", (PyCFunction)_ssl__SSLSocket_get_ech_status, METH_NOARGS, _ssl__SSLSocket_get_ech_status__doc__}, + +static PyObject * +_ssl__SSLSocket_get_ech_status_impl(PySSLSocket *self); + +static PyObject * +_ssl__SSLSocket_get_ech_status(PySSLSocket *self, PyObject *Py_UNUSED(ignored)) +{ + return _ssl__SSLSocket_get_ech_status_impl(self); +} + +PyDoc_STRVAR(_ssl__SSLSocket_get_ech_retry_config__doc__, +"get_ech_retry_config($self, /)\n" +"--\n" +"\n"); + +#define _SSL__SSLSOCKET_GET_ECH_RETRY_CONFIG_METHODDEF \ + {"get_ech_retry_config", (PyCFunction)_ssl__SSLSocket_get_ech_retry_config, METH_NOARGS, _ssl__SSLSocket_get_ech_retry_config__doc__}, + +static PyObject * +_ssl__SSLSocket_get_ech_retry_config_impl(PySSLSocket *self); + +static PyObject * +_ssl__SSLSocket_get_ech_retry_config(PySSLSocket *self, PyObject *Py_UNUSED(ignored)) +{ + return _ssl__SSLSocket_get_ech_retry_config_impl(self); +} + +PyDoc_STRVAR(_ssl__SSLSocket_set_outer_server_name__doc__, +"set_outer_server_name($self, outer_server_name, /)\n" +"--\n" +"\n"); + +#define _SSL__SSLSOCKET_SET_OUTER_SERVER_NAME_METHODDEF \ + {"set_outer_server_name", (PyCFunction)_ssl__SSLSocket_set_outer_server_name, METH_O, _ssl__SSLSocket_set_outer_server_name__doc__}, + +static PyObject * +_ssl__SSLSocket_set_outer_server_name_impl(PySSLSocket *self, + const char *outer_server_name); + +static PyObject * +_ssl__SSLSocket_set_outer_server_name(PySSLSocket *self, PyObject *arg) +{ + PyObject *return_value = NULL; + const char *outer_server_name; + + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("set_outer_server_name", "argument", "str", arg); + goto exit; + } + Py_ssize_t outer_server_name_length; + outer_server_name = PyUnicode_AsUTF8AndSize(arg, &outer_server_name_length); + if (outer_server_name == NULL) { + goto exit; + } + if (strlen(outer_server_name) != (size_t)outer_server_name_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + return_value = _ssl__SSLSocket_set_outer_server_name_impl(self, outer_server_name); + +exit: + return return_value; +} + PyDoc_STRVAR(_ssl__SSLSocket_shared_ciphers__doc__, "shared_ciphers($self, /)\n" "--\n" @@ -873,6 +944,40 @@ _ssl__SSLContext__set_alpn_protocols(PySSLContext *self, PyObject *arg) return return_value; } +PyDoc_STRVAR(_ssl__SSLContext__set_outer_alpn_protocols__doc__, +"_set_outer_alpn_protocols($self, protos, /)\n" +"--\n" +"\n"); + +#define _SSL__SSLCONTEXT__SET_OUTER_ALPN_PROTOCOLS_METHODDEF \ + {"_set_outer_alpn_protocols", (PyCFunction)_ssl__SSLContext__set_outer_alpn_protocols, METH_O, _ssl__SSLContext__set_outer_alpn_protocols__doc__}, + +static PyObject * +_ssl__SSLContext__set_outer_alpn_protocols_impl(PySSLContext *self, + Py_buffer *protos); + +static PyObject * +_ssl__SSLContext__set_outer_alpn_protocols(PySSLContext *self, PyObject *arg) +{ + PyObject *return_value = NULL; + Py_buffer protos = {NULL, NULL}; + + if (PyObject_GetBuffer(arg, &protos, PyBUF_SIMPLE) != 0) { + goto exit; + } + Py_BEGIN_CRITICAL_SECTION(self); + return_value = _ssl__SSLContext__set_outer_alpn_protocols_impl(self, &protos); + Py_END_CRITICAL_SECTION(); + +exit: + /* Cleanup for protos */ + if (protos.obj) { + PyBuffer_Release(&protos); + } + + return return_value; +} + #if defined(_ssl__SSLContext_verify_mode_HAS_DOCSTR) # define _ssl__SSLContext_verify_mode_DOCSTR _ssl__SSLContext_verify_mode__doc__ #else @@ -1776,6 +1881,41 @@ _ssl__SSLContext_set_default_verify_paths(PySSLContext *self, PyObject *Py_UNUSE return return_value; } +PyDoc_STRVAR(_ssl__SSLContext_set_ech_config__doc__, +"set_ech_config($self, ech_config, /)\n" +"--\n" +"\n" +"Set the ECH configuration on the SSL context.\n" +"\n" +"The echconfig parameter should be a bytes-like object containing the raw ECH configuration."); + +#define _SSL__SSLCONTEXT_SET_ECH_CONFIG_METHODDEF \ + {"set_ech_config", (PyCFunction)_ssl__SSLContext_set_ech_config, METH_O, _ssl__SSLContext_set_ech_config__doc__}, + +static PyObject * +_ssl__SSLContext_set_ech_config_impl(PySSLContext *self, + Py_buffer *ech_config); + +static PyObject * +_ssl__SSLContext_set_ech_config(PySSLContext *self, PyObject *arg) +{ + PyObject *return_value = NULL; + Py_buffer ech_config = {NULL, NULL}; + + if (PyObject_GetBuffer(arg, &ech_config, PyBUF_SIMPLE) != 0) { + goto exit; + } + return_value = _ssl__SSLContext_set_ech_config_impl(self, &ech_config); + +exit: + /* Cleanup for ech_config */ + if (ech_config.obj) { + PyBuffer_Release(&ech_config); + } + + return return_value; +} + PyDoc_STRVAR(_ssl__SSLContext_set_ecdh_curve__doc__, "set_ecdh_curve($self, name, /)\n" "--\n" @@ -2839,4 +2979,4 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #ifndef _SSL_ENUM_CRLS_METHODDEF #define _SSL_ENUM_CRLS_METHODDEF #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ -/*[clinic end generated code: output=4c2af0c8fab7ec4e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3b9063915c60ea1a input=a9049054013a1b77]*/ diff --git a/configure b/configure index b1ced3106618ba6..71977670cdceeed 100755 --- a/configure +++ b/configure @@ -28951,6 +28951,50 @@ LIBS=$save_LIBS + for ac_header in openssl/ech.h +do : + ac_fn_c_check_header_compile "$LINENO" "openssl/ech.h" "ac_cv_header_openssl_ech_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_ech_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_ECH_H 1" >>confdefs.h + have_openssl_ech_h=yes +else $as_nop + have_openssl_ech_h=no +fi + +done +if test "$have_openssl_ech_h" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenSSL ECH support" >&5 +printf %s "checking for OpenSSL ECH support... " >&6; } + ac_fn_check_decl "$LINENO" "SSL_ECH_STATUS_GREASE_ECH" "ac_cv_have_decl_SSL_ECH_STATUS_GREASE_ECH" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_SSL_ECH_STATUS_GREASE_ECH" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_SSL_ECH_STATUS_GREASE_ECH $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + +printf "%s\n" "#define OPENSSL_ECH 1" >>confdefs.h + +else $as_nop + +printf "%s\n" "#define OPENSSL_NO_ECH 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_SSL_ECH_STATUS_GREASE_ECH" >&5 +printf "%s\n" "$ac_cv_have_decl_SSL_ECH_STATUS_GREASE_ECH" >&6; } +else + +printf "%s\n" "#define OPENSSL_NO_ECH 1" >>confdefs.h + +fi + + # ssl module default cipher suite string diff --git a/configure.ac b/configure.ac index 3a55cbc13203933..f35bb405f74e7b5 100644 --- a/configure.ac +++ b/configure.ac @@ -7384,6 +7384,22 @@ WITH_SAVE_ENV([ ]) ]) +AC_CHECK_HEADERS([openssl/ech.h], [have_openssl_ech_h=yes], [have_openssl_ech_h=no]) +if test "$have_openssl_ech_h" = "yes"; then + AC_MSG_CHECKING([for OpenSSL ECH support]) + AC_CHECK_DECLS([SSL_ECH_STATUS_GREASE_ECH], + [AC_DEFINE([OPENSSL_ECH], [1], + [Define if OpenSSL has ECH support])], + [AC_DEFINE([OPENSSL_NO_ECH], [1], + [Define if OpenSSL does not have ECH support])], + [#include ]) + AC_MSG_RESULT([$ac_cv_have_decl_SSL_ECH_STATUS_GREASE_ECH]) +else + AC_DEFINE([OPENSSL_NO_ECH], [1], + [Define if OpenSSL does not have ECH support]) +fi + + # ssl module default cipher suite string AH_TEMPLATE([PY_SSL_DEFAULT_CIPHERS], [Default cipher suites list for ssl module. diff --git a/debian/2to3.1 b/debian/2to3.1 new file mode 100644 index 000000000000000..f896799dea4d5f8 --- /dev/null +++ b/debian/2to3.1 @@ -0,0 +1,41 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4. +.TH 2TO3-3.3 "1" "January 2012" "2to3-3.3 3.3" "User Commands" +.SH NAME +2to3-3.3 \- Python2 to Python3 converter +.SH SYNOPSIS +.B 2to3 +[\fIoptions\fR] \fIfile|dir \fR... +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-d\fR, \fB\-\-doctests_only\fR +Fix up doctests only +.TP +\fB\-f\fR FIX, \fB\-\-fix\fR=\fIFIX\fR +Each FIX specifies a transformation; default: all +.TP +\fB\-j\fR PROCESSES, \fB\-\-processes\fR=\fIPROCESSES\fR +Run 2to3 concurrently +.TP +\fB\-x\fR NOFIX, \fB\-\-nofix\fR=\fINOFIX\fR +Prevent a transformation from being run +.TP +\fB\-l\fR, \fB\-\-list\-fixes\fR +List available transformations +.TP +\fB\-p\fR, \fB\-\-print\-function\fR +Modify the grammar so that print() is a function +.TP +\fB\-v\fR, \fB\-\-verbose\fR +More verbose logging +.TP +\fB\-\-no\-diffs\fR +Don't show diffs of the refactoring +.TP +\fB\-w\fR, \fB\-\-write\fR +Write back modified files +.TP +\fB\-n\fR, \fB\-\-nobackups\fR +Don't write backups for modified files diff --git a/debian/2to3.py b/debian/2to3.py new file mode 100755 index 000000000000000..bf4194b64ce0461 --- /dev/null +++ b/debian/2to3.py @@ -0,0 +1,5 @@ +#! /usr/bin/python3 +import sys +from lib2to3.main import main + +sys.exit(main("lib2to3.fixes")) diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 000000000000000..898e0408de03681 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,17 @@ +More documentation and README's for this package can be found in the directory + + /usr/share/doc/python3.6/ + +The upstream documentation can be found after installation +of the python-doc package in the directory + + /usr/share/doc/python3/html + + +A draft of the "Debian Python Policy", mostly needed for Debian package +maintainers can be found in + + /usr/share/doc/python + +Sometime it will be moved to /usr/share/doc/debian-policy in the +debian-policy package. diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 000000000000000..ca20f0ad2befc66 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,1460 @@ +python3-defaults (3.7.3-1) unstable; urgency=medium + + * Bump version to 3.7.3. + + -- Matthias Klose Tue, 26 Mar 2019 11:25:14 +0100 + +python3-defaults (3.7.2-1) unstable; urgency=medium + + * Bump version to 3.7.2. + * Bump standards version. + + -- Matthias Klose Fri, 18 Jan 2019 08:54:49 +0100 + +python3-defaults (3.7.1-3) unstable; urgency=medium + + * Remove 3.6 as a supported Python3 versions. + + -- Matthias Klose Wed, 19 Dec 2018 03:54:07 +0100 + +python3-defaults (3.7.1-2) unstable; urgency=medium + + * Default python3 version to 3.7, targeting sid/buster. + * Fix FTCBFS: Annotate python build dependencies with :any (Helmut Grohne). + Closes: #912899. + + -- Matthias Klose Wed, 21 Nov 2018 13:04:27 +0100 + +python3-defaults (3.7.1-1) experimental; urgency=medium + + * Default python3 version to 3.7. + + -- Matthias Klose Sun, 21 Oct 2018 14:23:45 +0200 + +python3-defaults (3.6.7-1) unstable; urgency=high + + * Really ship the policy in the python3 package, and update from the last + version found in the python package. Closes: #910113. + * Bump version to 3.6.7. + + -- Matthias Klose Sun, 21 Oct 2018 11:21:31 +0200 + +python3-defaults (3.6.6-1) unstable; urgency=medium + + [ Matthias Klose ] + * Fix the idle desktop file. Closes: #901096. + * Install the policy files in the python3 package. Closes: #901486. + * python3-minimal: Pre-Depend on python3.6-minimal. Closes: #901001. + * Bump version to 3.6.6. + + [ Scott Kitterman ] + * Remove myself from uploaders + + -- Matthias Klose Wed, 27 Jun 2018 18:18:20 +0200 + +python3-defaults (3.6.5-5) experimental; urgency=medium + + * Fix typo in the defaults file. Closes: #900937, #900949. + + -- Matthias Klose Thu, 07 Jun 2018 17:57:53 +0200 + +python3-defaults (3.6.5-4) experimental; urgency=medium + + * Update Vcs attributes. + * Add Python 3.7 to the list of supported Python3 versions. + + -- Matthias Klose Wed, 06 Jun 2018 18:26:50 +0200 + +python3-defaults (3.6.5-3) unstable; urgency=medium + + * Update valgrind support file. LP: #1513364. + * debian/control.in (Michael Vogt): + - add Cnf-Visible-Pkgname hint to ensure command-not-found recommends + installing "python3" instead of "python3-minimal" when it is missing. + + -- Matthias Klose Tue, 10 Apr 2018 11:48:03 +0200 + +python3-defaults (3.6.5-2) unstable; urgency=medium + + * Distinguish between python3.6 and python3-stdlib-extensions versions. + Closes: #894168. + * python3-venv: Depend on python3-distutils. + + -- Matthias Klose Mon, 02 Apr 2018 07:06:32 +0200 + +python3-defaults (3.6.5-1) unstable; urgency=medium + + [ Matthias Klose ] + * Bump version to 3.6.5. + + [ Michael Vogt ] + * debian/control.in: LP: #1752415 + - add "XB-Cnf-Extra-Commands: python" to ensure command-not-found + outputs the python3 package when searching for "python" + - add XB-Cnf-Priority-Bonus to ensure python3 is listed on the + top when typing "python" + + -- Matthias Klose Sat, 31 Mar 2018 16:26:32 +0800 + +python3-defaults (3.6.5~rc1-1) unstable; urgency=medium + + * Bump version to 3.6.5~rc1. + * Remove dh-python dependency from python3. + * Add dh-python and python3-distutils dependencies to python3-all and + python3-dev. + + -- Matthias Klose Sun, 25 Mar 2018 19:05:26 +0800 + +python3-defaults (3.6.4-1) unstable; urgency=medium + + * Bump version to 3.6.4. + * 2to3: Depend on python3-lib2to3 and provide the 2to3 launcher. + + -- Matthias Klose Fri, 29 Dec 2017 23:53:39 +0100 + +python3-defaults (3.6.4~rc1-2) unstable; urgency=medium + + * 2to3: Fix breaks/replaces relation with python. Closes: #884418. + + -- Matthias Klose Fri, 15 Dec 2017 08:24:00 +0100 + +python3-defaults (3.6.4~rc1-1) unstable; urgency=medium + + * Bump version to 3.6.4~rc1. + * Stop using priority extra for the -dbg packages. + * Build a 2to3 package. + + -- Matthias Klose Wed, 13 Dec 2017 23:52:01 +0100 + +python3-defaults (3.6.3-2) unstable; urgency=medium + + * Remove python3.5 as a supported Python3 version. + + -- Matthias Klose Thu, 26 Oct 2017 21:09:05 +0200 + +python3-defaults (3.6.3-1) unstable; urgency=medium + + * Bump version to 3.6.3. + * Update more references from 3.5 to 3.6. + * Rename the idle3 package to idle, keep a transitional idle3 package. + * Fix idle script to run with Python3. + * Bump standards version to 4.1.1. + + -- Matthias Klose Tue, 10 Oct 2017 08:36:04 +0200 + +python3-defaults (3.6.2-1) experimental; urgency=medium + + * Default python3 version to 3.6. + * Bump standards version to 4.1.0. + * Change policy format from debiandoc SGML to DocBook/XML (W. Martin Borgert). + Closes: #871526, #872581. + * Fix some invalid escape sequences that make autopkgtests fail by causing + warnings on stderr (Michael Hudson-Doyle). + * python3-doc, python3-examples: Mark M-A: foreign. + + -- Matthias Klose Mon, 18 Sep 2017 19:52:28 +0200 + +python3-defaults (3.5.3-3) unstable; urgency=medium + + * Upload to unstable + * Update python3 version number in debian/README.Debian (Closes: + #826565) + * Add debian/watch, thanks to Taylor Kline for the patch (Closes: + #850789) + * No VCS cruft in the tarball this time (Closes: #854974) + * Bump standards version to 4.0.0 without further change + * Delete ancient Breaks/Replaces for idle3 and python3-minimal + + -- Scott Kitterman Wed, 28 Jun 2017 23:07:12 -0400 + +python3-defaults (3.5.3-2) experimental; urgency=medium + + * Add python3.6 to supported python3 versions for experimental + + -- Scott Kitterman Fri, 16 Jun 2017 22:09:52 -0400 + +python3-defaults (3.5.3-1) unstable; urgency=medium + + * Bump version to 3.5.3. + + -- Matthias Klose Fri, 20 Jan 2017 11:03:28 +0100 + +python3-defaults (3.5.1-4) unstable; urgency=medium + + * Bump standards version. + * Rebuild to pick up the GNU triplet change on i386 archs. Addresses: #826128. + + -- Matthias Klose Fri, 03 Jun 2016 01:34:07 +0200 + +python3-defaults (3.5.1-3) unstable; urgency=medium + + * Drop build dependency on python3.4. + * Bump standards and debhelper versions. + + -- Matthias Klose Mon, 21 Mar 2016 12:58:34 +0100 + +python3-defaults (3.5.1-2) unstable; urgency=medium + + * Drop Python 3.4 as a supported python3 version. + + -- Matthias Klose Mon, 22 Feb 2016 12:53:25 +0100 + +python3-defaults (3.5.1-1) unstable; urgency=medium + + * Upload to unstable + + [ Scott Kitterman ] + * Drop redundant supported/default version definitions in debpython/ + version.py + + [ Matthias Klose ] + * Bump version to 3.5.1. + * Stop shipping menu files. + + -- Scott Kitterman Mon, 11 Jan 2016 11:35:49 -0500 + +python3-defaults (3.5.0-2) experimental; urgency=medium + + * Update py3versions to list versions in a consistent order: default listed + last and non-default listed first in ascending order (Closes: #801376) + + -- Scott Kitterman Sat, 10 Oct 2015 21:21:44 -0400 + +python3-defaults (3.5.0-1) experimental; urgency=medium + + * Set python3.5 as the default python3 for testing in experimental + + -- Scott Kitterman Mon, 05 Oct 2015 16:44:27 -0400 + +python3-defaults (3.4.3-7) unstable; urgency=medium + + * Update py3versions to list versions in a consistent order: default listed + last and non-default listed first in ascending order (Closes: #801376) + + -- Scott Kitterman Sun, 11 Oct 2015 12:50:01 -0400 + +python3-defaults (3.4.3-6) unstable; urgency=medium + + * Upload to unstable + - Adds python3.5 as a supported python3 version in unstable + * Update idle3 desktop file to better support use from file managers such as + nautilus (Closes: #796125) + - Thanks to Pat Hooper for the patch + + -- Scott Kitterman Thu, 24 Sep 2015 21:47:47 -0400 + +python3-defaults (3.4.3-5) experimental; urgency=medium + + * Readd python3.5 as a supported version for experimental + + -- Scott Kitterman Sat, 27 Jun 2015 18:50:26 -0400 + +python3-defaults (3.4.3-4) unstable; urgency=medium + + * Upload to unstable + + [ Matthias Klose ] + * Update README for python 3.4. Closes: #772545. + + [ Scott Kitterman ] + * Drop python3.5 as a supported version for upload to unstable + + -- Scott Kitterman Sat, 27 Jun 2015 18:47:18 -0400 + +python3-defaults (3.4.3-2) experimental; urgency=medium + + * Add python3.5 as a supported Python version. + + -- Matthias Klose Wed, 03 Jun 2015 01:41:07 +0200 + +python3-defaults (3.4.3-1) experimental; urgency=medium + + * Bump version to 3.4.3. + * Make python3-minimal a pre-dependency for python3. + + -- Matthias Klose Sat, 28 Feb 2015 17:05:58 +0100 + +python3-defaults (3.4.2-2) unstable; urgency=medium + + * py3clean: remove pyc files generated from files with dot in its name + (workaraunds http://bugs.python.org/issue22966) + + -- Piotr Ożarowski Sat, 29 Nov 2014 18:14:17 +0100 + +python3-defaults (3.4.2-1) unstable; urgency=medium + + [ Scott Kitterman ] + * Drop unused B-D-I on libhtml-tree-perl + * Use dpkg-vendor instead of lsb-release to determine distribution. + + [ Matthias Klose ] + * Bump version to 3.4.2. + * Bump standards version to 3.9.6. + * Build-depend on python3.4 and dpkg-dev versions to consistently + generate the i586-* symlinks. Closes: #762980. + + -- Matthias Klose Wed, 08 Oct 2014 12:52:49 +0200 + +python3-defaults (3.4.1-1) unstable; urgency=medium + + * Bump version to 3.4.1. + * Drop python3.3 as a supported python version. + * Build a python3-venv binary package. + * Fix lintian warnings. + * py3versions: Ignore blank lines before the source section in the control + file. Closes: #739935. + + -- Matthias Klose Wed, 04 Jun 2014 12:39:42 +0200 + +python3-defaults (3.4.1~rc1-1) unstable; urgency=medium + + * Upload to unstable + * Bump version to 3.4.1~rc1 + + -- Scott Kitterman Tue, 27 May 2014 22:49:41 -0400 + +python3-defaults (3.4~rc1-1) experimental; urgency=medium + + * Default to python3.4. + + -- Matthias Klose Wed, 12 Feb 2014 13:03:28 +0100 + +python3-defaults (3.3.4-1) unstable; urgency=medium + + * Bump version to 3.3.4. + + -- Matthias Klose Wed, 12 Feb 2014 11:15:40 +0100 + +python3-defaults (3.3.3-1) experimental; urgency=low + + * Add python3.4 as a supported python version. + + -- Matthias Klose Thu, 26 Dec 2013 00:39:55 +0100 + +python3-defaults (3.3.2-17) unstable; urgency=low + + * Add Multi-Arch: allowed for python3-all-dev. + + -- Matthias Klose Wed, 18 Sep 2013 15:46:08 +0200 + +python3-defaults (3.3.2-16) unstable; urgency=low + + * Restore :any relationship for python3-minimal build-dep now that it is + supported on the buildds + + -- Scott Kitterman Sat, 07 Sep 2013 17:11:07 -0400 + +python3-defaults (3.3.2-15) unstable; urgency=low + + * Drop non-existing :any from python3-minimal build-dep. + + -- Scott Kitterman Sun, 18 Aug 2013 11:38:29 -0400 + +python3-defaults (3.3.2-14) unstable; urgency=low + + * Add python3.1 and python3.2 to unsupported-versions + * Build-depend on python3-minimal:any instead of python since that's what's + used during the build now + * Build-depend on python3-docutils instead of python-docutils + * Add Multi-Arch: allowed for python3-all and python3-all-dbg + * Add libpython3-dbg to python3-dbg depends + * Add libpython3-dev to python3-dev depends + * Use generated depends in control.in for libpython3-stdlib as with other + binaries + * Set UPSTRVER for Ubuntu in debian/rules so correct results are produced in + both Debian and Ubuntu + + -- Scott Kitterman Sun, 18 Aug 2013 06:22:22 -0400 + +python3-defaults (3.3.2-13) unstable; urgency=low + + * Bump python3-minimal Breaks/Replaces python3 versions to 3.3.2-13~ to + account for files moved in -4 and later (Closes: #718734) + * Fix broken libpython3-all-dbg symlink + + -- Scott Kitterman Mon, 05 Aug 2013 02:25:13 -0400 + +python3-defaults (3.3.2-12) unstable; urgency=low + + * Re-upload with a version newer than the one in experimental. + * Build libpython3-all-{dev,dbg} and libpython3-stdlib packages. + * Move debiandoc-sgml and lsb-release from Build-Depends-Indep to + Build-Depends. + + -- Matthias Klose Sat, 03 Aug 2013 09:52:26 +0200 + +python3-defaults (3.3.2-5) unstable; urgency=low + + * Drop python3.2 from supported python3 versions + + -- Scott Kitterman Fri, 02 Aug 2013 22:58:22 -0400 + +python3-defaults (3.3.2-4) unstable; urgency=low + + * Upload to unstable + * Remove /usr/share/python3/debpython/__pycache__ in python3-minimal's prerm + * Change source format back to 1.0 (native) + + -- Piotr Ożarowski Thu, 01 Aug 2013 21:41:34 +0200 + +python3-defaults (3.3.2-11) experimental; urgency=low + + * Make datetime module optional in debpython (it's not available in + python3.X-minimal, closes: #717232) + + -- Piotr Ożarowski Thu, 18 Jul 2013 22:50:17 +0200 + +python3-defaults (3.3.2-10) experimental; urgency=low + + [ Matthias Klose ] + * Move py3compile and py3clean back to the python3-minimal package. + + [ Piotr Ożarowski ] + * Remove pybuild and dh_python3, dh-python source package provides it now + * Add dh-python dependency in python3 package (to make sure dh_python3 is + installed) + * Bump Standards-Version to 3.9.4 + + -- Piotr Ożarowski Mon, 15 Jul 2013 23:48:04 +0200 + +python3-defaults (3.3.2-3) unstable; urgency=low + + * Bump python3-minimal Breaks/Replaces python3 versions to 3.3.2-1~ to + account for files moved in -2 (closes: #717373) + + -- Scott Kitterman Sun, 21 Jul 2013 09:30:39 -0400 + +python3-defaults (3.3.2-2) unstable; urgency=low + + [ Matthias Klose ] + * Build dependency packages as architecture dependent packages. + * Make python3, python3-{minimal,dev,dbg} Multi-Arch: allowed. + * Don't use the `u' abi flag when defaulting to 3.3. + * Build Multi-Arch: same packages libpython3-{dev,dbg} packages providing + $(DEB_HOST_MULTIARCH)-python3-config symlinks. + + [ Piotr Ożarowski ] + * Move python-docutils to Build-Depends (python3 package is now arch:any) + + [ Dmitry Shachnev ] + * Include architecture.mk in debian/rules instead of defining + DEB_HOST_* manually. + + [ Scott Kitterman ] + * Correct doc directory in README.Debian + * Bump standards version to 3.9.4 without further change + + -- Scott Kitterman Wed, 17 Jul 2013 17:14:22 -0400 + +python3-defaults (3.3.2-1) unstable; urgency=low + + [ Scott Kitterman ] + * Make python3.3 the default python3 + * When X-Python3-Version is not present, do not describe it as missing, + just indicate it is not there + + [ Matthias Klose ] + * Bump version to 3.3.2. + * Don't use the `u' abi flag when defaulting to 3.3. + + -- Scott Kitterman Sun, 14 Jul 2013 18:35:33 -0400 + +python3-defaults (3.3.0-3) experimental; urgency=low + + [ Piotr Ożarowski ] + * pybuild: + - add --ext-dest-dir (PYBUILD_EXT_DESTDIR) and --ext-pattern + (PYBUILD_EXT_PATTERN) options to move files after install step + - save before/after command logs if quiet mode is on + - do not warn about limiting versions if there's only one + - distutils plugin: do not skip build in install target + (ugly workaround for yet another distutils "feature", + closes: #701137) + - do not run tests if DEB_BUILD_OPTIONS contains "nocheck" + * dh_python3: + - add version range to py3compile in maintainer scripts + - no longer sensitive to trailing slash in private dir names + (closes: #701215) + * Bump minimum required dpkg-dev build dependency to 1.16.1~ + (due to architecture.mk in debian/rules) + + [ Dmitry Shachnev ] + * Include architecture.mk in debian/rules instead of defining + DEB_HOST_* manually. + * tests/t1: Build-depend on python3-all instead of python-all. + * Make tests work without python-support installed. + * debian/tests/control: Add a dependency on libjs-jquery (test1 contains + a symlink to /usr/share/javascript/jquery/jquery.js). + * Added missing docinfo to man pages, to fix a lintian warning + (Closes: #702777). + + [ Matthias Klose ] + * dh_python3: Use the multiarch tuple for the host (if DEB_HOST_MULTIARCH + is set in the environment). + * Add a libpython3-stdlib package (not yet built). + + -- Piotr Ożarowski Sun, 17 Mar 2013 13:47:29 +0100 + +python3-defaults (3.3.0-2) experimental; urgency=low + + [ Piotr Ożarowski ] + * dh_python3: + - add multiarch support (rename extensions in dist-packages) + - rename foomodule.so to foo.so in dist-packages (for Python >= 3.3) + * pybuild: + - add --{before,after}-{clean,configure,build,install,test} + command line options and many more PYBUILD_FOO environment vars + (f.e. PYBUILD_DESTDIR, PYBUILD_DESTDIR_python3, + PYBUILD_DESTDIR_python3.3-dbg) + - add --disable command line option (to disable step, interpreter, version + or any mix of them); drop --no-clean and --no-tests arguments + (replaced by --disable clean, --disable test or --disable 'clean test') + - add new build system to dh sequencer (dh --buildsystem=pybuild) + - add manpage + * Move python-docutils to Build-Depends (python3 package is now arch:any) + + [ Matthias Klose ] + * Build dependency packages as architecture dependent packages. + * Make python3, python3-{minimal,dev,dbg} Multi-Arch: allowed. + * Don't use the `u' abi flag when defaulting to 3.3. + * Build Multi-Arch: same packages libpython3-{dev,dbg} packages providing + $(DEB_HOST_MULTIARCH)-python3-config symlinks. + * Add Multi-Arch: same packages libpython3-all-{dev,dbg} (not yet built, + python3.2 doesn't have support for multiarch). + + [ Dmitry Shachnev ] + * debpython/interpreter.py: fix failing doctest + (architecture no longer hardcoded) + * Added DEP-8 tests (Closes: #698002). + + -- Piotr Ożarowski Sat, 12 Jan 2013 17:13:14 +0100 + +python3-defaults (3.3.0-1) experimental; urgency=low + + [ Piotr Ożarowski ] + * Add Python 3.3 to the list of supported Python 3 versions and make it a + default one. + * dh_python3: + - remove egg-info file/dir while moving files to common directory + if the later one already contains it + * rewrite dh_python3.1, py3compile.1 and py3clean.1 manpages in + ReStructured Text + * Add pybuild + + [ Scott Kitterman ] + * Update Makefile to install pybuild + * Fix file name typo in README.derivatives + + -- Scott Kitterman Mon, 26 Nov 2012 09:20:46 -0500 + +python3-defaults (3.2.3-7) unstable; urgency=low + + * Add Python 3.3 as a supported Python version. + + -- Matthias Klose Mon, 06 May 2013 03:05:02 +0200 + +python3-defaults (3.2.3-6) unstable; urgency=low + + [ Piotr Ożarowski ] + * dh_python3 + - ignore empty files while trying to normalize shebangs + - mention the right file (debian/py3dist-overrides) while warning about + guessed dependency - thanks to Sebastian Ramacher for the patch + (Closes: #685067) + - fix generating dependencies when maximum version is specified + (Closes: #687060) + * py3versions.py: fix parsing DEBPYTHON3_SUPPORTED env. variable + (versions should be separated using comma, as in debian_defaults + config file) + * py3versions, debpython: close previously opened files - thanks to Dmitry + Shachnev for the patch (Closes: #686587) + + [ Dmitry Shachnev ] + [ Barry Warsaw ] + * py3clean: Don't remove everything in the __pycache__ directory for + system site package directories. Prevents bogus cleaning of unrelated + *.pyc files. Original patch by Dmitry, with review, clean up, small + modifications, and additional comments by Barry. (Closes: #685167) + + [ Barry Warsaw ] + * dh_python3: Rework calculation of extension tags to add support for + Python 3.3's different suffixes, and to allow for unadorned .so files + to assume they are built with the default Python 3 version. + Closes: 672178 + * README.derivatives: It is no longer necessary to edit + debian/py3versions.py since the values are taken from + debian_defaults. Also added some text on how to separate the + specification when multiple versions are supported. + * Makefile: Fix the nosetests3 command. Closes: 690259 + + -- Piotr Ożarowski Sun, 21 Oct 2012 21:29:45 +0200 + +python3-defaults (3.2.3-5) unstable; urgency=low + + * dh_python3: + - do not rewrite /usr/bin/python{,2.*} shebangs + (Closes: #683294, /me still thinks it was a feature, not a bug) + - parsing debian/control fields is now case insensitive + * Change source format from native to 3.0 (native) + + -- Piotr Ożarowski Thu, 02 Aug 2012 23:26:08 +0200 + +python3-defaults (3.2.3-4) unstable; urgency=high + + * py3clean: really close #681389 + + -- Piotr Ożarowski Thu, 12 Jul 2012 22:45:47 -0600 + +python3-defaults (3.2.3-3) unstable; urgency=high + + * Yet another update in SHEBANG_RE to handle even more cases + * test4 fixed to catch missing /usr/bin/python → /usr/bin/python3 rewrites + * py3clean: accept --package *and* directory name at the same time + (change missed in -1 upload, closes: #681389) + * Bump minimum required python3 version to 3.2.3-3~ in packages with .py files + (due to --package option that is added to py3compile/py3clean in rtupdate + scripts) + + -- Piotr Ożarowski Thu, 12 Jul 2012 12:40:42 -0600 + +python3-defaults (3.2.3-2) unstable; urgency=high + + * Urgency high for grave bug because this will cause other packages to + misbuild + * Correct SHEBANG_RE in debpython/tools.py to not capture the 3 from python3 + (Closes: #681235) + + -- Scott Kitterman Wed, 11 Jul 2012 11:51:46 -0400 + +python3-defaults (3.2.3-1) unstable; urgency=low + + * Bump upstream version to match current unstable/wheezy python3.2 version + * dh_python3: + - generates rtupdate scripts for private directories that compile files + from given package only, add --compile-all to dh_python3's call if you + want the old behaviour (i.e. compile also files (plugins?) provided by + other packages, which do not use a helper/bytecompile them) + - rewrite shebangs by default (disable via --no-shebang-rewrite), + examples: + + "/usr/bin/env python3*" → "/usr/bin/python3*" + + "/usr/local/bin/python3 foo" → "/usr/bin/python3 foo" + - new --shebang option to replace all shebangs in bin dirs + (example: --shebang /usr/bin/python3) + - translate Python version numbers into Debian ones for those + require.txt items that have a pydist file with (uscan like) rules + or PEP386 flag + * py3versions, dh_python3, py3compile: allow to override system's list of + supported Python3 versions via DEBPYTHON3_SUPPORTED and default Python3 + version via DEBPYTHON3_DEFAULT env. variables + * Debhelper's python3 sequence now inserts dh_python3 before dh_installinit + + -- Piotr Ożarowski Sat, 30 Jun 2012 15:20:39 +0200 + +python3-defaults (3.2.3~rc2-1) unstable; urgency=low + + [ Scott Kitterman ] + * Drop unused XS-Python-Version support from dh_python3 + * Remove unused debian/pyversions support from dh_python3 + * Remove unused support for comma delimited lists of versions with + X-Python3-Version from py3versions and debpython/debhelper.py (dh_python3) + * Clean up log messages in py3versions a bit + * Remove unused code related to parsing debian/pyversions from + debian/py3versions + * idle3 should Break as well as Replace python3 + * Correct Python package names with hyphens in them being ignored + (Closes: #657667) + * Fix python3.2 related deprecation and resource warnings in + debian/py3versions.py (Closes: #670471) + * Drop -n from /usr/bin/idle3 invocations in debian/idle.desktop and + debian/idle.menu (Closes: #671704) + * dh_python3, py3versions: make comparison of X-Python-Version field names + case-insensitive (Closes: #676225) + - Change based on Piotr Ożarowski's change for python-defaults + * Bump upstream version number to match python3.2 (3.2.3~rc2) + * Bump minimum debhelper version to 7.0.50~ to support minumum version + needed by tests + * Add debian/python3-minimal.postinst.in and python3-minimal.prerm to + support byte compiling py3versions.py (Closes: #672226) + - byte compiling only works if py3compile is present, which it may not be + on fresh installs, but removing .pyc files is reliable (best we can do + without moving py3compile to python3-minimal + * Move /usr/bin/py3versions -> ../share/python3/py3versions.py symlink from + python3 to python3-minimal to match the change in python-defaults + - Add Breaks/Replaces + + [ Piotr Ożarowski ] + * Generate correct python3 (<< 3.X) dependencies when maximum Python 3 + version is specified (Closes: #675703) + + -- Scott Kitterman Tue, 05 Jun 2012 23:58:13 -0400 + +python3-defaults (3.2.3~rc1-2) unstable; urgency=low + + * Fix max version expansion for -V/X-P-V to be the max version and not +1 + * Move idle3.xpm symlink from python3 to idle3 and add Replaces + * Add 'dependency package' to long description of python3-all, + python3-all-dev, and python3-all-dbg + + -- Scott Kitterman Fri, 16 Mar 2012 17:19:58 -0400 + +python3-defaults (3.2.3~rc1-1) unstable; urgency=low + + * debpython/depends.py: + - Add functional support for -V, specify list of supported Python versions + for dh_python3 + * Adjust upstream version number to match current python3.2 version + * Bump standards version to 3.9.3 without further change + + -- Scott Kitterman Thu, 15 Mar 2012 00:43:38 -0400 + +python3-defaults (3.2.2-1) unstable; urgency=low + + [ Scott Kitterman ] + * Update upstream version to match python3.2 + * Add versioned idle3 package to idle3 depends (Closes: #637973) + * Fix typo in debian/py3versions.1 (Closes: #651342) + - Patch thanks to Daniel Stender + * Specify Python 3 and not just Python in python3-doc/dbg descriptions + * Add build-arch and build-indep targets in debian/rules + * Add native-package-with-dash-version to source lintian overrides + * Add idle3.lintian-overrides for menu-icon-missing since it is provided + in the python3 package + * Bump standards version to 3.9.2 without further change + + [ Matthias Klose ] + * Add symlinks for python3-config man page. + * Add symlinks for binaries and man pages including the abi flags. + + [ Piotr Ożarowski ] + * py3compile: + - fix -O option + - speed up a bit (remove unnecessary interpreter calls) + + -- Scott Kitterman Wed, 11 Jan 2012 17:26:18 -0500 + +python3-defaults (3.2.2~rc1-2) unstable; urgency=medium + + * Medium urgency to avoid blocking the python2.7 transition + * python3 now provides python3-profiler + * Drop suggests on old (non-free) python3-profiler package + + -- Scott Kitterman Wed, 28 Sep 2011 11:29:05 -0400 + +python3-defaults (3.2.2~rc1-1) unstable; urgency=low + + * Update upstream version to match python3.2 + * dh_python3: Assume .so files without tag in /usr/lib/python3/ are built for + Python 3.2 instead of for Python 3.1 + * dh_python3 and dh_python3.1: add --no-dbg-cleaning option (to disable + removing files from debug packages) from dh_python2 + + -- Scott Kitterman Sun, 25 Sep 2011 01:14:16 -0400 + +python3-defaults (3.2-3) unstable; urgency=low + + * Fix a typo in dh_python3 and generate correct prerm scripts + (with py3clean rather than pyclean, thanks to IRIE Shinsuke for bug + reporta and a patch, closes: 622708, LP: #760401) + + -- Piotr Ożarowski Thu, 14 Apr 2011 21:44:29 +0200 + +python3-defaults (3.2-2) unstable; urgency=low + + [ Piotr Ożarowski ] + * Drop Python 3.1 from supported Python 3 versions + * python.mk: add py_builddir and py_builddir_sh macros. + $(call py_builddir, 3.2) returns "build/lib.linux-x86_64-3.2" on amd64 + + [ Scott Kitterman ] + * Upload to unstable + + -- Scott Kitterman Sun, 03 Apr 2011 19:02:43 -0400 + +python3-defaults (3.2-1) experimental; urgency=low + + [ Piotr Ożarowski ] + * dh_python3 and py3compile: read /usr/share/python3/debian_defaults to get + default Python 3 version and a list of supported Python 3 versions + * py3compile: + - let py_compile.py warn about syntax errors again + * dh_python3: + - fix checking shebangs in private directories (executable bit wasn't + checked correctly) + - private modules without extensions will not cause FTBFS anymore + (closes: 617358, thanks to IRIE Shinsuke for the patch) + - generate "python3 (>= 3.X), python3 (<< 3.Y)" dependencies if package + provides public extensions + - make egg-info files/dirs searches case insensitive + + [ Scott Kitterman ] + * More Python/Python 3 in package descriptions + + -- Scott Kitterman Wed, 23 Mar 2011 22:48:56 -0400 + +python3-defaults (3.2~rc1-2) experimental; urgency=low + + * dh_python3: add support for DH_OPTIONS env. variable + * disable check_versions test and drop python3 package from Build-Depends + + -- Piotr Ożarowski Thu, 20 Jan 2011 23:29:04 +0100 + +python3-defaults (3.2~rc1-1) experimental; urgency=low + + * Bump Python minimum version to >= 3.2~rc1 + * dh_python3: ignore binary files while checking shebangs + * py3compile: fix magic number check + + -- Piotr Ożarowski Wed, 19 Jan 2011 19:16:30 +0100 + +python3-defaults (3.2~b2-2) experimental; urgency=low + + * dh_python3 + - fix moving files from old debug locations + - move as many files to /usr/lib/python3/dist-packages as possible + (files that cannot be shared between Python 3.X versions are left in + original location for now) + - add tag name to Python >= 3.2 extensions if they're missing (due to + custom build system) in /usr/lib/pythonX.Y/dist-packages directories + + -- Piotr Ożarowski Thu, 06 Jan 2011 21:22:51 +0100 + +python3-defaults (3.2~b2-1) experimental; urgency=low + + [ Matthias Klose ] + * Default to Python 3.2. + * py3compile: + - Don't over-optimize, check the timestamps of byte-code files. + - Add options -f/--force, -O. + - Copy stdout/stderr of py_compile processes in case of error. + - Propagate the exit value of the py_compile processes. + - Update manual page. + * Bump depends to require the fixed pycompile for dh_python3 based package + builds. + * Don't touch the standard python library in rtupdate scripts. + + [ Piotr Ożarowski ] + * dh_python3: + - do not rename .so files outside dist-packages directory + (Python 3.1 tag name will be added only in public directories) + - generate proper dependencies/maintainer scripts for private + directories with private extensions for more than one Python version + - fix a crash in packages with private extension, test2 added (to test + architecture dependent packages) + * Invoke /usr/share/python3/runtime.d/ hooks in python3's preinst and + postinst + + [ Scott Kitterman ] + * Convert python.desktop to python3.desktop + + -- Scott Kitterman Thu, 23 Dec 2010 17:55:40 -0500 + +python3-defaults (3.1.3-15) experimental; urgency=low + + [ Matthias Klose ] + * Depend on the 3.1.1 versions of the packages. + + [ Piotr Ożarowski ] + * py3compile: do not try to check if interpreter is present when version + range is empty + + -- Matthias Klose Tue, 30 Nov 2010 18:43:11 +0100 + +python3-defaults (3.1.2-15) experimental; urgency=low + + * debpython/version.py: Add 3.2 as supported version. + + -- Matthias Klose Sat, 16 Oct 2010 15:03:53 +0200 + +python3-defaults (3.1.2-14) experimental; urgency=low + + * Add python3.2 as a supported version. + + -- Matthias Klose Thu, 14 Oct 2010 16:42:31 +0200 + +python3-defaults (3.1.2-12) unstable; urgency=low + + * Upload to unstable + + -- Piotr Ożarowski Wed, 22 Sep 2010 23:20:10 +0200 + +python3-defaults (3.1.2-11) experimental; urgency=low + + * dh_python3: + - egg renaming fixed + - generate correct dependency for /usr/bin/python3 shebangs + + -- Piotr Ożarowski Wed, 15 Sep 2010 23:18:56 +0200 + +python3-defaults (3.1.2-10) experimental; urgency=low + + * dh_python3: fix python3:Versions and python3:Provides (now lists Python + versions for which public extensions are provided by binary package) + + -- Piotr Ożarowski Mon, 13 Sep 2010 23:03:02 +0200 + +python3-defaults (3.1.2-9) experimental; urgency=low + + * dh_python3: add tag name to extension files that are missing it + (to avoid conflicts with python3.2 in Wheezy) + + -- Piotr Ożarowski Sun, 12 Sep 2010 19:05:46 +0200 + +python3-defaults (3.1.2-8) experimental; urgency=low + + * py3compile: recognize /usr/lib/python3/ directories correctly + (dh_python3: minimum required python version bumped to 3.1.2-8) + + -- Piotr Ożarowski Sun, 12 Sep 2010 17:26:21 +0200 + +python3-defaults (3.1.2-7) experimental; urgency=low + + [ Piotr Ożarowski ] + * py3versions.py: open debian/control files with encoding='utf-8' as + otherwise all my packages (with "ż" in debian/control) will FTBFS if + user's locale is not set to UTF-8 (f.e. in build daemons) + * dh_python3: + - adjust to python3.1 3.1.2+20100909-1 changes + - move files from /usr/lib/python3.X/dist-packages to + /usr/lib/python3/dist-packages + - set the right minimum required python3 package version in + packages with private modules (for py3compile) + - add dist_fallback file with a list of Python distribution name and + Debian package name pairs (to be used as a fall back source for + PyDist feature) + - if dist_fallback and `dpkg -S` fails to find the right package name, + fall back to package name recommended by Debian Python Policy (use + debian/py3dist-overrides file to override) + * py3compile, py3clean: adjust to PEP 3147 changes, -R option removed + * Add manpages for dh_python3, py3compile and py3clean + * Add README.derivatives (source package) + + [ Matthias Klose ] + * python3: Install /usr/share/python3/python.mk. + * python.mk (py_libdir): Return /usr/lib/python3/dist-packages for 3.x + versions. + * python.mk (py_pkgname): New macro to refer the package name depending + on the python version. + * Generate dependencies on python3 (>= 3.1.2-7~). + * Require python3.1 3.1.2+20100909 as minimal version. + + -- Piotr Ożarowski Sun, 12 Sep 2010 15:54:25 +0200 + +python3-defaults (3.1.2-6) unstable; urgency=low + + [ Matthias Klose ] + * Substitution variables for control files always start with a `python3' + prefix (python:Versions -> python3:Versions, python:Provides -> + python3:Provides). + * Generate dependencies on python3 (>= 3.1.2-6~). + + [ Piotr Ożarowski ] + * py3compile: do not hang if interpreters are not started in the same order + as they're used + * dh_python3: pass shallow=False to cmpfiles to make sure file comparison + works as expected + + [ Scott Kitterman ] + * Us X-Python3-Version for Python 3 instead of XS-Python-Version (which + should just be used for Python) + + -- Piotr Ożarowski Fri, 13 Aug 2010 23:27:45 +0200 + +python3-defaults (3.1.2-5) unstable; urgency=medium + + * Add README.PyDist to python3-doc package + * py3compile: compile public module for the right Python version + * dh_python3: rename --depend to --depends, --recommend to --recommends and + --suggest to --suggests + * Bump Standards-Version to 3.9.1 + + -- Piotr Ożarowski Wed, 28 Jul 2010 22:34:17 +0200 + +python3-defaults (3.1.2-4) unstable; urgency=low + + * dh_python3: + - add --depend, --recommend and --suggest command line options + (use it if requires.txt doesn't contain dependency that package needs) + - add {/usr,}/sbin to the list of directories with checked shebangs + * py3compile: do not exit before all background byte compilation is finished + + -- Piotr Ożarowski Sun, 25 Jul 2010 16:25:04 +0200 + +python3-defaults (3.1.2-3) unstable; urgency=low + + [ Piotr Ożarowski ] + * pyclean, pycompile: use .communicate() instead of .wait() to avoid hanging + `dpkg -L PACKAGE` in few situations + * dh_python3: follow Distribute and replace all non-alphanumeric + characters with underscore in distribution name + * Add python3.{postinst,prerm} scripts + * python3-doc now suggests python3-examples + * Bump Standards-Version to 3.9.0 + + [ Scott Kitterman ] + * Drop deprecated call to dh_desktop from debian/rules + * Bump PREVVER to 3.1.2-3~ for support for stdin in py_compile.py + + [ Matthias Klose ] + * Provide the python3.pc symlink in python3-dev. + * Call py3clean/py3compile on rtupdate in generated scripts. + + -- Matthias Klose Tue, 20 Jul 2010 20:20:01 +0200 + +python3-defaults (3.1.2-2) unstable; urgency=low + + * Add Vcs-Browser field + * Add some lintian overrides (for false positives) + - bump minimum required debhelper version to 6.0.7 (due to dh_lintian) + * py3compile, py3clean and dh_python3 moved to python3 package + * dh_python3: + - some bugs fixed (encoding problems, parsing Python-Version, + few python vs python3 leftovers) + + -- Piotr Ożarowski Wed, 23 Jun 2010 22:57:23 +0200 + +python3-defaults (3.1.2-1) unstable; urgency=low + + [ Matthias Klose ] + * Depend on the 3.1.2 versions of the packages. + * Add py3clean, py3compile binaries to be called from python3-* + maintainer scripts. + * Don't allow installation of a mix of defaults packages for different + python3 versions. + + [ Scott Kitterman ] + * Provide default and supported Python3 versions (3.1 to start) + - Rename pyversions(.py)(.1) to py3versions(.py)(.1) + - Port py3versions.py to Python 3 + - Update py3versions to use python3 specific locations + - Update py3versions to ignore all, current and python versions < 3.0 and + not to use debian/pyversions + - Update debian_defaults for python3 + - Install debian_defaults for python3 + - Update debian/rules + * Update debian/copyright from python3.1 LICENSE file + * Add myself to uploaders + + [ Piotr Ożarowski ] + * Add dh_python3, py3compile and py3clean + * Add myself to Uploaders + + -- Matthias Klose Fri, 18 Jun 2010 00:10:21 +0200 + +python3-defaults (3.1.1-1) unstable; urgency=low + + * Depend on the 3.1.1 versions of the packages. + + -- Matthias Klose Fri, 22 Jan 2010 17:44:37 +0100 + +python3-defaults (3.1-1) experimental; urgency=low + + * Depend on the 3.1 versions of the packages. + + -- Matthias Klose Thu, 23 Jul 2009 17:27:33 +0200 + +python3-defaults (3.0.1-0ubuntu4) jaunty; urgency=low + + * Make idle3 actually run with /usr/bin/python3. (LP: #336381) + * Remove unused idle.sh that led to the previous confusion. + + -- Anders Kaseorg Thu, 12 Mar 2009 15:37:50 -0400 + +python3-defaults (3.0.1-0ubuntu3) jaunty; urgency=low + + * Make idle3 run with /usr/bin/python3, not /usr/bin/python. + (LP: #336381) + * Remove Essential: yes from python3-minimal, and reduce the Priority of + python3 and python3-minimal to optional. (LP: #330613) + + -- Anders Kaseorg Sun, 08 Mar 2009 18:30:38 -0400 + +python3-defaults (3.0.1-0ubuntu2) jaunty; urgency=low + + * Depend on the 3.0.1 versions of the packages. + + -- Matthias Klose Mon, 16 Feb 2009 23:23:06 +0100 + +python3-defaults (3.0~b3-0ubuntu1) intrepid; urgency=low + + * Build new defaults for python3. + + -- Matthias Klose Mon, 15 Sep 2008 22:21:59 +0000 + +python-defaults (2.5.2-1ubuntu1) intrepid; urgency=low + + * Merge with Debian; remaining changes: + - Build the -doc package from this source package. + - Omit Debian specific upgrade code. + - Regenerate the control file. + + -- Matthias Klose Mon, 23 Jun 2008 13:13:51 +0200 + +python-defaults (2.5.2-0ubuntu1) hardy; urgency=low + + * Depend on the 2.5.2 versions of the packages. + + -- Matthias Klose Mon, 10 Mar 2008 18:03:30 +0000 + +python-defaults (2.5.1-1ubuntu2) gutsy; urgency=low + + * Temporarily loosen the dependency on python2.5 to allow python2.5 + to build on powerpc and sparc. + + -- Matthias Klose Fri, 27 Apr 2007 00:00:32 +0200 + +python-defaults (2.5.1-1ubuntu1) gutsy; urgency=low + + * Depend on the 2.5.1 versions of the packages. + + -- Matthias Klose Thu, 26 Apr 2007 11:23:17 +0200 + +python-defaults (2.5.1~rc1-0ubuntu3) feisty; urgency=low + + * Fix versioned build dependency on python2.5. + + -- Matthias Klose Fri, 13 Apr 2007 06:37:58 +0200 + +python-defaults (2.5.1~rc1-0ubuntu2) feisty; urgency=low + + * Add a sanity check, that /usr/bin/python points to the default + python version. Users tend to modify this symlink, which then + breaks stuff in obscure ways. Ubuntu #75557, Debian #418002. + + -- Matthias Klose Fri, 6 Apr 2007 17:47:24 +0200 + +python-defaults (2.5.1~rc1-0ubuntu1) feisty; urgency=low + + * Depend on the 2.5.1~rc1 versions of the packages. + + -- Matthias Klose Fri, 6 Apr 2007 11:13:10 +0000 + +python-defaults (2.5-0ubuntu6) feisty; urgency=low + + * python-dbg: Add a python-dbg-config binary. + + -- Matthias Klose Sat, 17 Feb 2007 21:39:44 +0100 + +python-defaults (2.5-0ubuntu5) feisty; urgency=low + + * python-all-dbg: Tighten dependencies on the python2.x-dbg packages. + * python-dbg: Provide python-gdbm-dbg, python-tk-dbg, + link to README.debug, SpecialBuilds.txt.gz. + * python-dev: Add an unversioned python-config binary. + * Readd build-dependency on python-docutils. + * Set Ubuntu maintainer address. + * Update the FAQ. + + -- Matthias Klose Fri, 16 Feb 2007 18:18:06 +0100 + +python-defaults (2.5-0ubuntu4) feisty; urgency=low + + * New package python-all-dbg. + + -- Matthias Klose Fri, 9 Feb 2007 01:16:09 +0100 + +python-defaults (2.5-0ubuntu3) feisty; urgency=low + + * Temporarily remove build-dependency on python-docutils. + + -- Matthias Klose Fri, 12 Jan 2007 13:06:50 +0000 + +python-defaults (2.5-0ubuntu2) feisty; urgency=low + + * Fix icon for desktop file. + * Robustify building the faq html pages. + * Make the suggestions of various packages versioned. + * Recommend depending on "pythonX.X-foo, python-foo" instead of recommending + to only depend on "pythonX.X-foo" when a particular version is needed to + permit upgrades from real packages to virtual ones. (Loic Minier). + + -- Matthias Klose Fri, 12 Jan 2007 11:42:02 +0000 + +python-defaults (2.5-0ubuntu1) feisty; urgency=low + + * Make python2.5 the default version. + + -- Matthias Klose Fri, 12 Jan 2007 09:10:52 +0000 + +python-defaults (2.4.4-1ubuntu2) feisty; urgency=low + + * python-minimal is essential, not python. + + -- Matthias Klose Thu, 7 Dec 2006 14:25:20 +0000 + +python-defaults (2.4.4-1ubuntu1) feisty; urgency=low + + * Merge with Debian unstable. + - Backout: Add 2.5 to unsupported-versions. + * Build the FAQ again. + + -- Matthias Klose Thu, 16 Nov 2006 15:21:31 -0800 + +python-defaults (2.4.4-1) unstable; urgency=medium + + * Depend on the 2.4.4 versions of the packages. + * Sync pyversions.py with python-central. + * Move 2.3 to old-versions, from supported-versions. + * Add 2.5 to unsupported-versions. + + -- Matthias Klose Sun, 29 Oct 2006 11:06:39 +0100 + +python-defaults (2.4.3-11ubuntu3) edgy; urgency=low + + * Temporarily remove the FAQ and the build-dependency on python-docutils, + so that the build dependencies can be installed. + + -- Matthias Klose Wed, 20 Sep 2006 17:28:47 +0000 + +python-defaults (2.4.3-11ubuntu2) edgy; urgency=low + + * debian/pyversions: + - merged the changes from python-central to support older python + version (and not break on upgrades) + + -- Michael Vogt Wed, 20 Sep 2006 16:42:12 +0200 + +python-defaults (2.4.3-11ubuntu1) edgy; urgency=low + + * Merge with Debian unstable. + + -- Matthias Klose Fri, 8 Sep 2006 00:22:21 +0200 + +python-defaults (2.4.3-11) unstable; urgency=low + + * Add a conflict to python-central (<< 0.5.5). + + -- Matthias Klose Sun, 13 Aug 2006 19:32:59 +0000 + +python-defaults (2.4.3-10) unstable; urgency=low + + * Upload to unstable. Closes: #347440, #360851. + * Let the preinst fail on the first failing pre-rtupdate hook, + after running the corresponding failed-pre-rtupdate hook. + * Reflect renaming of the docutils binaries. Closes: #377601. + * Update the upstream FAQ. + + -- Matthias Klose Sat, 12 Aug 2006 20:28:30 +0200 + +python-defaults (2.4.3-9) experimental; urgency=low + + * Fix syntax error in python.preinst. Closes: #381673. + + -- Matthias Klose Sun, 6 Aug 2006 12:39:34 +0000 + +python-defaults (2.4.3-8) experimental; urgency=low + + * idle: Depend on python-tk, add desktop and menu files. + + -- Matthias Klose Sat, 5 Aug 2006 18:38:31 +0000 + +python-defaults (2.4.3-7) experimental; urgency=low + + * Update pyversions.py from 2.3.5-11. + * Fix pyversions(1), -r takes exactly one parameter. + * idle: Remove the dependency on idle-pythonX.Y, add start script + and man page. + + -- Matthias Klose Sat, 5 Aug 2006 17:34:43 +0000 + +python-defaults (2.4.3-6) experimental; urgency=low + + * Remove python's dependency on python-central. Closes: #372658. + * On upgrade of the runtime to a new major version, call the hooks + (executable files) in /usr/share/python/runtime.d/*.rtupdate. + - in python.preinst, call the script with parameters + pre-rtupdate . + run all hooks, then return exit with the correct exit status. + - in python.postinst, call the script with parameters + rtupdate . + run all hooks, then return exit with the correct exit status. + - in python.postinst, call the script with parameters + post-rtupdate . + run all hooks, then return exit with the correct exit status. + * pyversions -r: If the XS-Python-Version field cannot be found in + debian/control, fall back to debian/pyversions for the version + information. Return with an error code, if the intersection of + the versions in debian/pyversions and the supported python versions + is empty. Fall back to the supported versions if no version + information can be found. Based on a patch from Raphael Hertzog. + * Reflect renaming of the docutils binaries. Closes: #377601. + + -- Matthias Klose Sat, 5 Aug 2006 17:54:43 +0200 + +python-defaults (2.4.3-5ubuntu1) edgy; urgency=low + + * Synchronize with Debian experimental. + * Remove python's dependency on python-central. On upgrade of + the runtime, call hooks /usr/share/python/runtime.d/*.rtupdate. + Addresses: #372658. + * pyversions -r: If the XS-Python-Version field cannot be found in + debian/control, fall back to debian/pyversions for the version + information. Return with an error code, if the intersection of + the versions in debian/pyversions and the supported python versions + is empty. Fall back to the supported versions if no version + information can be found. Based on a patch from Raphael Hertzog. + + -- Matthias Klose Wed, 5 Jul 2006 05:11:42 +0000 + +python-defaults (2.4.3-5) experimental; urgency=low + + * Tighten dependencies between packages built from this source. + A versioned dependency on python-all / python-all-dev is enough + to depend on the same version of python / python-dev. + * python: Conflict with python-central (<< 0.4.17). + * python: Depend on a python2.4 built for the updated Python policy. + * python: Conflict with a python2.3 using the old Python policy. + + -- Matthias Klose Fri, 16 Jun 2006 18:15:00 +0200 + +python-defaults (2.4.3-4) experimental; urgency=low + + * Include version 0.4.1.0 of the python policy. + * Fix 'pyversions -i'. + + -- Matthias Klose Tue, 13 Jun 2006 09:44:22 +0200 + +python-defaults (2.4.3-3) experimental; urgency=low + + * Point to the draft of the reworked Python policy. + * Fix 'pyversions -r current' (Raphael Hertzog). + + -- Matthias Klose Mon, 12 Jun 2006 13:40:52 +0200 + +python-defaults (2.4.3-02) experimental; urgency=low + + * Really do not build python-doc. + + -- Matthias Klose Sun, 11 Jun 2006 23:25:02 +0000 + +python-defaults (2.4.3-1ubuntu1) edgy; urgency=low + + * Let the -all packages depend on the default packages (closes: #365219). + * Add /usr/share/python/debian_defaults for some default values (i.e. + the supported python versions). + * Add /etc/python/debian_config for byte-compilation options. + * Add a pyversions script to give information about python versions and + parse the XS-Python-Version attribute. + * Include version 0.4.1.0 of the python policy. + + -- Matthias Klose Tue, 13 Jun 2006 13:22:43 +0200 + +python-defaults (2.4.3-01) experimental; urgency=low + + * Do not build the python-doc package from this source. + + -- Matthias Klose Sun, 11 Jun 2006 23:59:17 +0200 + +python-defaults (2.4.3-0) experimental; urgency=low + + * Upload to experimental. + * Do not build the python-tk and python-gdbm packages from this source. + * Let the -all packages depend on the default packages (closes: #365219). + * Add /usr/share/python/debian_defaults for some default values (i.e. + the supported python versions). + * Add /etc/python/debian_config for byte-compilation options. + * Add a pyversions script to give information about python versions and + parse the XS-Python-Version attribute. + + -- Matthias Klose Sun, 11 Jun 2006 12:57:03 +0000 + +python-defaults (2.4.2-1) unstable; urgency=low + + * Change the default python version to 2.4. + * Depend on python-central. + + -- Matthias Klose Thu, 12 Jan 2006 01:16:10 +0000 + +python-defaults (2.3.5-4) unstable; urgency=low + + * Add a package python-minimal. This package still depends on python2.3, + will depend on python2.4-minimal when changing the default python version. + * Add two dependency packages python-all and python-all-dev. These + packages are used as build dependencies to determine the set of + python version and implementations, which should be / currently are + supported. Currently it depends on python2.3 and python2.4. Future + versions may add an updated version of jython and ironpython. + * Update FAQ. + + -- Matthias Klose Thu, 12 Jan 2006 00:32:32 +0100 + +python-defaults (2.3.5-3) unstable; urgency=low + + * Add python-dbg package. + * debian/control.in: idle enhances python. + + -- Matthias Klose Sun, 19 Jun 2005 13:49:16 +0200 + +python-defaults (2.3.5-2) unstable; urgency=low + + * Add valgrind support file /usr/lib/valgrind/python.supp (closes: #291128). + * python-doc: Add an conflict/replace to older python packages. + Closes: #297266. + + -- Matthias Klose Sat, 19 Mar 2005 22:49:29 +0100 + +python-defaults (2.3.5-1) unstable; urgency=low + + * Depend on python-2.3.5 packages. + * Update FAQ. + * python suggests python-profiler. + + -- Matthias Klose Sat, 12 Feb 2005 19:26:48 +0100 + +python-defaults (2.3.4-6) unstable; urgency=low + + * Add an 'Enhances: konsole' to the python package (closes: #286161). + + -- Matthias Klose Sun, 16 Jan 2005 12:53:58 +0100 + +python-defaults (2.3.4-5) unstable; urgency=low + + * Add conflict/replaces to ooold python-base package (closes: #279035). + + -- Matthias Klose Sun, 14 Nov 2004 11:44:14 +0100 + +python-defaults (2.3.4-4) unstable; urgency=low + + * Regenerate control file after adding python-docutils build dependency. + Closes: #270177. + + -- Matthias Klose Mon, 6 Sep 2004 07:19:49 +0200 + +python-defaults (2.3.4-3) testing-proposed-updates; urgency=low + + * Unmodified 2.3.4-3sid, destination sarge, fixing build failure. + + -- Matthias Klose Fri, 20 Aug 2004 18:24:25 +0200 + +python-defaults (2.3.4-3sid) unstable; urgency=low + + * Add build dependency on python-docutils (closes: #266550). + + -- Matthias Klose Wed, 18 Aug 2004 12:30:37 +0200 + +python-defaults (2.3.4-2sid) unstable; urgency=low + + * Add pdb and pdb.1 symlinks. + * Update FAQ. + + -- Matthias Klose Tue, 17 Aug 2004 16:17:06 +0200 + +python-defaults (2.3.4-1) unstable; urgency=low + + * Depend on python-2.3.4 packages. + * Update FAQ. + + -- Matthias Klose Mon, 10 May 2004 06:58:24 +0200 + +python-defaults (2.3.3-7) unstable; urgency=low + + * Fix symlinks to proposed policy files (closes: #234874). + + -- Matthias Klose Thu, 26 Feb 2004 22:28:07 +0100 + +python-defaults (2.3.3-6) unstable; urgency=low + + * Build the default packages from a separate source package to ease + migration between python versions. + * Update to the proposed python-policy: byte-compile using -E. + + -- Matthias Klose Wed, 4 Feb 2004 23:16:35 +0100 diff --git a/debian/chunk.xsl b/debian/chunk.xsl new file mode 100644 index 000000000000000..b4df4c380eb28d9 --- /dev/null +++ b/debian/chunk.xsl @@ -0,0 +1,16 @@ + + + + + 1 + 0 + 1 + 1 + 1 + _blank + 1 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 000000000000000..ec635144f600489 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 000000000000000..bff761f55a2dc75 --- /dev/null +++ b/debian/control @@ -0,0 +1,272 @@ +Source: python3-defaults +Section: python +Priority: optional +Maintainer: Matthias Klose +Uploaders: Piotr Ożarowski +Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.17.11), python3.7:any (>= 3.7.3-1~), + lsb-release, + python3-minimal:any, + python3-docutils, + docbook-xml, + docbook-xsl, + w3m, + xsltproc, +Standards-Version: 4.3.0 +Homepage: https://www.python.org/ +Vcs-Git: https://salsa.debian.org/cpython-team/python3-defaults.git +Vcs-Browser: https://salsa.debian.org/cpython-team/python3-defaults + +Package: python3 +Architecture: any +Multi-Arch: allowed +Pre-Depends: python3-minimal (= ${binary:Version}) +Depends: python3.7 (>= 3.7.3-1~), libpython3-stdlib (= ${binary:Version}), ${misc:Depends} +Suggests: python3-doc (>= ${binary:Version}), python3-tk (>= 3.7.2-1~) , python3-venv (>= ${binary:Version}) +Replaces: python3-minimal (<< 3.1.2-2) +Provides: python3-profiler +Description: interactive high-level object-oriented language (default python3 version) + Python, the high-level, interactive object oriented language, + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v3.7). +XB-Cnf-Extra-Commands: python +XB-Cnf-Priority-Bonus: 5 + +Package: python3-venv +Architecture: any +Multi-Arch: allowed +Depends: python3.7-venv (>= 3.7.3-1~), python3 (= ${binary:Version}), + python3-distutils (>= 3.7.2-1~), ${misc:Depends} +Description: pyvenv-3 binary for python3 (default python3 version) + Python, the high-level, interactive object oriented language, + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v3.7). + +Package: python3-minimal +Architecture: any +Multi-Arch: allowed +Pre-Depends: python3.7-minimal (>= 3.7.3-1~) +Depends: dpkg (>= 1.13.20), ${misc:Depends} +Description: minimal subset of the Python language (default python3 version) + This package contains the interpreter and some essential modules. It's used + in the boot process for some basic tasks. + See /usr/share/doc/python3.7-minimal/README.Debian for a list of the modules + contained in this package. +Cnf-Visible-Pkgname: python3 + +Package: python3-examples +Architecture: all +Multi-Arch: foreign +Depends: python3 (>= ${binary:Version}), python3.7-examples (>= 3.7.3-1~), ${misc:Depends} +Description: examples for the Python language (default version) + Examples, Demos and Tools for Python. These are files included in + the upstream Python distribution. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v3.7). + +Package: python3-dev +Architecture: any +Multi-Arch: allowed +Depends: python3 (= ${binary:Version}), libpython3-dev (= ${binary:Version}), + python3.7-dev (>= 3.7.3-1~), python3-distutils (>= 3.7.2-1~), + ${misc:Depends}, dh-python +Replaces: python3.1 (<< 3.1.2+20100706-3) +Description: header files and a static library for Python (default) + Header files, a static library and development tools for building + Python modules, extending the Python interpreter or embedding Python + in applications. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v3.7). + +Package: libpython3-dev +Architecture: any +Multi-Arch: same +Section: libdevel +Depends: libpython3.7-dev (>= 3.7.3-1~), ${misc:Depends} +Description: header files and a static library for Python (default) + Header files, a static library and development tools for building + Python modules, extending the Python interpreter or embedding Python + in applications. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v3.7). + +Package: libpython3-stdlib +Architecture: any +Multi-Arch: same +Depends: libpython3.7-stdlib (>= 3.7.3-1~), ${misc:Depends} +Description: interactive high-level object-oriented language (default python3 version) + Python, the high-level, interactive object oriented language, + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v3.7). + +Package: idle +Architecture: all +Depends: python3 (>= ${binary:Version}), python3-tk, ${misc:Depends}, idle-python3.7 +Enhances: python3 +Breaks: idle3 (<< 3.6.2-2) +Replaces: idle3 (<< 3.6.2-2) +Description: IDE for Python using Tkinter (default version) + IDLE is an Integrated Development Environment for Python. + IDLE is written using Tkinter and therefore quite platform-independent. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v3.7). + +Package: idle3 +Architecture: all +Section: oldlibs +Depends: python3 (>= ${binary:Version}), idle (>= ${binary:Version}), ${misc:Depends} +Description: IDE for Python using Tkinter (transitional package) + IDLE is an Integrated Development Environment for Python. + . + This package is a transitional package, you can safely remove it. + +Package: python3-doc +Section: doc +Architecture: all +Multi-Arch: foreign +Depends: python3.7-doc (>= 3.7.3-1~), ${misc:Depends} +Suggests: python3 (>= ${binary:Version}), python3-examples +Description: documentation for the high-level object-oriented language Python 3 + This is the official set of documentation for the interactive high-level + object-oriented language Python 3 (v3.7). All documents are provided + in HTML format, some in info format. The package consists of nine documents: + . + * Tutorial + * Python Library Reference + * Macintosh Module Reference + * Python Language Reference + * Extending and Embedding Python + * Python/C API Reference + * Installing Python Modules + * Documenting Python + * Distributing Python Modules + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v3.7). + +Package: python3-dbg +Architecture: any +Multi-Arch: allowed +Section: debug +Depends: python3 (= ${binary:Version}), libpython3-dbg (= ${binary:Version}), python3.7-dbg (>= 3.7.3-1~), ${misc:Depends} +Description: debug build of the Python 3 Interpreter (version 3.7) + Python 3 interpreter configured with --pydebug. Dynamically loaded modules + are searched in /usr/lib/python3.7/lib-dynload/debug first. + +Package: libpython3-dbg +Architecture: any +Multi-Arch: same +Section: debug +Depends: libpython3.7-dbg (>= 3.7.3-1~), ${misc:Depends} +Description: debug build of the Python 3 Interpreter (version 3.7) + Python 3 interpreter configured with --pydebug. Dynamically loaded modules + are searched in /usr/lib/python3.7/lib-dynload/debug first. + +Package: python3-all +Architecture: any +Multi-Arch: allowed +Depends: python3 (= ${binary:Version}), + ${misc:Depends}, + dh-python, + python3-distutils (>= 3.7.2-1~), + python3.7, +Description: package depending on all supported Python 3 runtime versions + The package currently depends on python3.7, in the future, + dependencies on jython (Python for a JVM) and ironpython (Python for Mono) + may be added. + . + This package is a dependency package used as a build dependency for other + packages to avoid hardcoded dependencies on specific Python 3 runtimes. + +Package: python3-all-dev +Architecture: any +Multi-Arch: allowed +Depends: python3 (= ${binary:Version}), + libpython3-all-dev (= ${binary:Version}), + python3-all (= ${binary:Version}), + python3-dev (= ${binary:Version}), + ${misc:Depends}, + python3.7-dev, +Description: package depending on all supported Python 3 development packages + The package currently depends on python3.7-dev, in the + future, dependencies on jython (Python for a JVM) and ironpython (Python + for Mono) may be added. + . + This package is a dependency package used as a build dependency for other + packages to avoid hardcoded dependencies on specific Python 3 development + packages. + +Package: python3-all-dbg +Architecture: any +Multi-Arch: allowed +Section: debug +Depends: python3 (= ${binary:Version}), + libpython3-all-dbg (= ${binary:Version}), + python3-all (= ${binary:Version}), + python3-dbg (= ${binary:Version}), + ${misc:Depends}, + python3.7-dbg, +Description: package depending on all supported Python 3 debugging packages + The package currently depends on python3.7-dbg, in the + future, dependencies on jython (Python for a JVM) and ironpython (Python + for Mono) may be added. + . + This package is a dependency package used as a build dependency for other + packages to avoid hardcoded dependencies on specific Python 3 debug packages. + +Package: libpython3-all-dev +Architecture: any +Multi-Arch: same +Section: libdevel +Depends: libpython3-dev (= ${binary:Version}), + ${misc:Depends}, + libpython3.7-dev, +Description: package depending on all supported Python 3 development packages + The package currently depends on libpython3.7-dev, in the + future, dependencies on jython (Python for a JVM) and ironpython (Python + for Mono) may be added. + . + This package is a dependency package used as a build dependency for other + packages to avoid hardcoded dependencies on specific Python 3 development + packages. + +Package: libpython3-all-dbg +Architecture: any +Multi-Arch: same +Section: debug +Depends: libpython3-dbg (= ${binary:Version}), + ${misc:Depends}, + libpython3.7-dbg, +Description: package depending on all supported Python 3 debugging packages + The package currently depends on libpython3.7-dbg, in the + future, dependencies on jython (Python for a JVM) and ironpython (Python + for Mono) may be added. + . + This package is a dependency package used as a build dependency for other + packages to avoid hardcoded dependencies on specific Python 3 debug packages. + +Package: 2to3 +Architecture: all +Multi-Arch: foreign +Depends: python3-lib2to3 (>= 3.7.2-1~), python3 (>= ${binary:Version}), ${misc:Depends} +Breaks: python (<< 2.7.14-4) +Replaces: python (<< 2.7.14-4) +Description: 2to3 binary using python3 + Python, the high-level, interactive object oriented language, + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package is a dependency package, which depends on Debian's default + Python 3 2to3 version (currently v3.7). diff --git a/debian/control.in b/debian/control.in new file mode 100644 index 000000000000000..a5025edfffaa023 --- /dev/null +++ b/debian/control.in @@ -0,0 +1,272 @@ +Source: python3-defaults +Section: python +Priority: optional +Maintainer: Matthias Klose +Uploaders: Piotr Ożarowski +Build-Depends: debhelper (>= 9), @bd_i586@ + lsb-release, + python3-minimal:any, + python3-docutils, + docbook-xml, + docbook-xsl, + w3m, + xsltproc, +Standards-Version: 4.3.0 +Homepage: https://www.python.org/ +Vcs-Git: https://salsa.debian.org/cpython-team/python3-defaults.git +Vcs-Browser: https://salsa.debian.org/cpython-team/python3-defaults + +Package: python3 +Architecture: any +Multi-Arch: allowed +Pre-Depends: python3-minimal (= ${binary:Version}) +Depends: python@VER@ (>= @UPSTRVER@), libpython3-stdlib (= ${binary:Version}), ${misc:Depends} +Suggests: python3-doc (>= ${binary:Version}), python3-tk (>= @STDLIBVER@) , python3-venv (>= ${binary:Version}) +Replaces: python3-minimal (<< 3.1.2-2) +Provides: python3-profiler +Description: interactive high-level object-oriented language (default python3 version) + Python, the high-level, interactive object oriented language, + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v@VER@). +XB-Cnf-Extra-Commands: python +XB-Cnf-Priority-Bonus: 5 + +Package: python3-venv +Architecture: any +Multi-Arch: allowed +Depends: python@VER@-venv (>= @UPSTRVER@), python3 (= ${binary:Version}), + python3-distutils (>= @STDLIBVER@), ${misc:Depends} +Description: pyvenv-3 binary for python3 (default python3 version) + Python, the high-level, interactive object oriented language, + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v@VER@). + +Package: python3-minimal +Architecture: any +Multi-Arch: allowed +Pre-Depends: python@VER@-minimal (>= @UPSTRVER@) +Depends: dpkg (>= 1.13.20), ${misc:Depends} +Description: minimal subset of the Python language (default python3 version) + This package contains the interpreter and some essential modules. It's used + in the boot process for some basic tasks. + See /usr/share/doc/python@VER@-minimal/README.Debian for a list of the modules + contained in this package. +Cnf-Visible-Pkgname: python3 + +Package: python3-examples +Architecture: all +Multi-Arch: foreign +Depends: python3 (>= ${binary:Version}), python@VER@-examples (>= @UPSTRVER@), ${misc:Depends} +Description: examples for the Python language (default version) + Examples, Demos and Tools for Python. These are files included in + the upstream Python distribution. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v@VER@). + +Package: python3-dev +Architecture: any +Multi-Arch: allowed +Depends: python3 (= ${binary:Version}), libpython3-dev (= ${binary:Version}), + python@VER@-dev (>= @UPSTRVER@), python3-distutils (>= @STDLIBVER@), + ${misc:Depends}, dh-python +Replaces: python3.1 (<< 3.1.2+20100706-3) +Description: header files and a static library for Python (default) + Header files, a static library and development tools for building + Python modules, extending the Python interpreter or embedding Python + in applications. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v@VER@). + +Package: libpython3-dev +Architecture: any +Multi-Arch: same +Section: libdevel +Depends: libpython@VER@-dev (>= @UPSTRVER@), ${misc:Depends} +Description: header files and a static library for Python (default) + Header files, a static library and development tools for building + Python modules, extending the Python interpreter or embedding Python + in applications. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v@VER@). + +Package: libpython3-stdlib +Architecture: any +Multi-Arch: same +Depends: libpython@VER@-stdlib (>= @UPSTRVER@), ${misc:Depends} +Description: interactive high-level object-oriented language (default python3 version) + Python, the high-level, interactive object oriented language, + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v@VER@). + +Package: idle +Architecture: all +Depends: python3 (>= ${binary:Version}), python3-tk, ${misc:Depends}, idle-python@VER@ +Enhances: python3 +Breaks: idle3 (<< 3.6.2-2) +Replaces: idle3 (<< 3.6.2-2) +Description: IDE for Python using Tkinter (default version) + IDLE is an Integrated Development Environment for Python. + IDLE is written using Tkinter and therefore quite platform-independent. + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v@VER@). + +Package: idle3 +Architecture: all +Section: oldlibs +Depends: python3 (>= ${binary:Version}), idle (>= ${binary:Version}), ${misc:Depends} +Description: IDE for Python using Tkinter (transitional package) + IDLE is an Integrated Development Environment for Python. + . + This package is a transitional package, you can safely remove it. + +Package: python3-doc +Section: doc +Architecture: all +Multi-Arch: foreign +Depends: python@VER@-doc (>= @UPSTRVER@), ${misc:Depends} +Suggests: python3 (>= ${binary:Version}), python3-examples +Description: documentation for the high-level object-oriented language Python 3 + This is the official set of documentation for the interactive high-level + object-oriented language Python 3 (v@VER@). All documents are provided + in HTML format, some in info format. The package consists of nine documents: + . + * Tutorial + * Python Library Reference + * Macintosh Module Reference + * Python Language Reference + * Extending and Embedding Python + * Python/C API Reference + * Installing Python Modules + * Documenting Python + * Distributing Python Modules + . + This package is a dependency package, which depends on Debian's default + Python 3 version (currently v@VER@). + +Package: python3-dbg +Architecture: any +Multi-Arch: allowed +Section: debug +Depends: python3 (= ${binary:Version}), libpython3-dbg (= ${binary:Version}), python@VER@-dbg (>= @UPSTRVER@), ${misc:Depends} +Description: debug build of the Python 3 Interpreter (version @VER@) + Python 3 interpreter configured with --pydebug. Dynamically loaded modules + are searched in /usr/lib/python@VER@/lib-dynload/debug first. + +Package: libpython3-dbg +Architecture: any +Multi-Arch: same +Section: debug +Depends: libpython@VER@-dbg (>= @UPSTRVER@), ${misc:Depends} +Description: debug build of the Python 3 Interpreter (version @VER@) + Python 3 interpreter configured with --pydebug. Dynamically loaded modules + are searched in /usr/lib/python@VER@/lib-dynload/debug first. + +Package: python3-all +Architecture: any +Multi-Arch: allowed +Depends: python3 (= ${binary:Version}), + ${misc:Depends}, + dh-python, + python3-distutils (>= @STDLIBVER@), + python3.7, +Description: package depending on all supported Python 3 runtime versions + The package currently depends on python3.7, in the future, + dependencies on jython (Python for a JVM) and ironpython (Python for Mono) + may be added. + . + This package is a dependency package used as a build dependency for other + packages to avoid hardcoded dependencies on specific Python 3 runtimes. + +Package: python3-all-dev +Architecture: any +Multi-Arch: allowed +Depends: python3 (= ${binary:Version}), + libpython3-all-dev (= ${binary:Version}), + python3-all (= ${binary:Version}), + python3-dev (= ${binary:Version}), + ${misc:Depends}, + python3.7-dev, +Description: package depending on all supported Python 3 development packages + The package currently depends on python3.7-dev, in the + future, dependencies on jython (Python for a JVM) and ironpython (Python + for Mono) may be added. + . + This package is a dependency package used as a build dependency for other + packages to avoid hardcoded dependencies on specific Python 3 development + packages. + +Package: python3-all-dbg +Architecture: any +Multi-Arch: allowed +Section: debug +Depends: python3 (= ${binary:Version}), + libpython3-all-dbg (= ${binary:Version}), + python3-all (= ${binary:Version}), + python3-dbg (= ${binary:Version}), + ${misc:Depends}, + python3.7-dbg, +Description: package depending on all supported Python 3 debugging packages + The package currently depends on python3.7-dbg, in the + future, dependencies on jython (Python for a JVM) and ironpython (Python + for Mono) may be added. + . + This package is a dependency package used as a build dependency for other + packages to avoid hardcoded dependencies on specific Python 3 debug packages. + +Package: libpython3-all-dev +Architecture: any +Multi-Arch: same +Section: libdevel +Depends: libpython3-dev (= ${binary:Version}), + ${misc:Depends}, + libpython3.7-dev, +Description: package depending on all supported Python 3 development packages + The package currently depends on libpython3.7-dev, in the + future, dependencies on jython (Python for a JVM) and ironpython (Python + for Mono) may be added. + . + This package is a dependency package used as a build dependency for other + packages to avoid hardcoded dependencies on specific Python 3 development + packages. + +Package: libpython3-all-dbg +Architecture: any +Multi-Arch: same +Section: debug +Depends: libpython3-dbg (= ${binary:Version}), + ${misc:Depends}, + libpython3.7-dbg, +Description: package depending on all supported Python 3 debugging packages + The package currently depends on libpython3.7-dbg, in the + future, dependencies on jython (Python for a JVM) and ironpython (Python + for Mono) may be added. + . + This package is a dependency package used as a build dependency for other + packages to avoid hardcoded dependencies on specific Python 3 debug packages. + +Package: 2to3 +Architecture: all +Multi-Arch: foreign +Depends: python3-lib2to3 (>= @STDLIBVER@), python3 (>= ${binary:Version}), ${misc:Depends} +Breaks: python (<< 2.7.14-4) +Replaces: python (<< 2.7.14-4) +Description: 2to3 binary using python3 + Python, the high-level, interactive object oriented language, + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package is a dependency package, which depends on Debian's default + Python 3 2to3 version (currently v@VER@). diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 000000000000000..b96d7cd724db1eb --- /dev/null +++ b/debian/copyright @@ -0,0 +1,319 @@ +This is the Debian GNU/Linux prepackaged version of the Python programming +language. Python was written by Guido van Rossum and others. + +This package was put together by Klee Dienes from +sources from ftp.python.org:/pub/python, based on the Debianization by +the previous maintainers Bernd S. Brentrup and +Bruce Perens. + +Current maintainer is Matthias Klose until the final +2.3 version is released. + + +Copyright notice (as found in LICENSE in the original source). +-------------------------------------------------------------- + +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations (now Zope +Corporation, see http://www.zope.com). In 2001, the Python Software +Foundation (PSF, see http://www.python.org/psf/) was formed, a +non-profit organization created specifically to own Python-related +Intellectual Property. Zope Corporation is a sponsoring member of +the PSF. + +All Python releases are Open Source (see http://www.opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.2 2.1.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2.1 2.2 2002 PSF yes + 2.2.2 2.2.1 2002 PSF yes + 2.2.3 2.2.2 2003 PSF yes + 2.3 2.2.2 2002-2003 PSF yes + 2.3.1 2.3 2002-2003 PSF yes + 2.3.2 2.3.1 2002-2003 PSF yes + 2.3.3 2.3.2 2002-2003 PSF yes + 2.3.4 2.3.3 2004 PSF yes + 2.3.5 2.3.4 2005 PSF yes + 2.4 2.3 2004 PSF yes + 2.4.1 2.4 2005 PSF yes + 2.4.2 2.4.1 2005 PSF yes + 2.4.3 2.4.2 2006 PSF yes + 2.4.4 2.4.3 2006 PSF yes + 2.5 2.4 2006 PSF yes + 2.5.1 2.5 2007 PSF yes + 2.5.2 2.5.1 2008 PSF yes + 2.5.3 2.5.2 2008 PSF yes + 2.6 2.5 2008 PSF yes + 2.6.1 2.6 2008 PSF yes + 2.6.2 2.6.1 2009 PSF yes + 2.6.3 2.6.2 2009 PSF yes + 2.6.4 2.6.3 2009 PSF yes + 3.0 2.6 2008 PSF yes + 3.0.1 3.0 2009 PSF yes + 3.1 3.0.1 2009 PSF yes + 3.1.1 3.1 2009 PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +Python Software Foundation; All Rights Reserved" are retained in Python alone or +in any derivative version prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the Internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the Internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +py3compile, py3clean and debpython module: +========================================== +Copyright © 2010-2013 Piotr Ożarowski + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/debian/debian_defaults b/debian/debian_defaults new file mode 100644 index 000000000000000..b31461950145f5c --- /dev/null +++ b/debian/debian_defaults @@ -0,0 +1,12 @@ +[DEFAULT] +# the default python3 version +default-version = python3.7 + +# all supported python3 versions +supported-versions = python3.7 + +# formerly supported python3 versions +old-versions = python3.1, python3.2, python3.3, python3.4, python3.5, python3.6 + +# unsupported versions, including older versions +unsupported-versions = python3.1, python3.2, python3.3, python3.4, python3.5, python3.6 diff --git a/debian/html.xsl b/debian/html.xsl new file mode 100644 index 000000000000000..8a3c75e2d924e3a --- /dev/null +++ b/debian/html.xsl @@ -0,0 +1,11 @@ + + + + + 1 + 1 + diff --git a/debian/idle.1 b/debian/idle.1 new file mode 100644 index 000000000000000..cc229ece6422a15 --- /dev/null +++ b/debian/idle.1 @@ -0,0 +1,104 @@ +.TH IDLE 1 "21 September 2004" +.SH NAME +\fBIDLE\fP \- An Integrated DeveLopment Environment for Python +.SH SYNTAX +.B idle [ \fI-dins\fP ] [ \fI-t title\fP ] [ \fIfile\fP ...] +.PP +.B idle [ \fI-dins\fP ] [ \fI-t title\fP ] ( \fI-c cmd\fP | \fI-r file\fP ) [ \fIarg\fP ...] +.PP +.B idle [ \fI-dins\fP ] [ \fI-t title\fP ] - [ \fIarg\fP ...] +.SH DESCRIPTION +This manual page documents briefly the +.BR idle +command. +This manual page was written for Debian +because the original program does not have a manual page. +For more information, refer to IDLE's help menu. +.PP +.B IDLE +is an Integrated DeveLopment Environment for Python. IDLE is based on +Tkinter, Python's bindings to the Tk widget set. Features are 100% pure +Python, multi-windows with multiple undo and Python colorizing, a Python +shell window subclass, a debugger. IDLE is cross-platform, i.e. it works +on all platforms where Tk is installed. +.LP +.SH OPTIONS +.TP +.B \-h +.PD +Print this help message and exit. +.TP +.B \-n +.PD +Run IDLE without a subprocess (see Help/IDLE Help for details). +.PP +The following options will override the IDLE 'settings' configuration: +.TP +.B \-e +.PD +Open an edit window. +.TP +.B \-i +.PD +Open a shell window. +.PP +The following options imply \-i and will open a shell: +.TP +.B \-c cmd +.PD +Run the command in a shell, or +.TP +.B \-r file +.PD +Run script from file. +.PP +.TP +.B \-d +.PD +Enable the debugger. +.TP +.B \-s +.PD +Run $IDLESTARTUP or $PYTHONSTARTUP before anything else. +.TP +.B \-t title +.PD +Set title of shell window. +.PP +A default edit window will be bypassed when \-c, \-r, or \- are used. +.PP +[arg]* and [file]* are passed to the command (\-c) or script (\-r) in sys.argv[1:]. +.SH EXAMPLES +.TP +idle +.PD +Open an edit window or shell depending on IDLE's configuration. +.TP +idle foo.py foobar.py +.PD +Edit the files, also open a shell if configured to start with shell. +.TP +idle \-est "Baz" foo.py +.PD +Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell +window with the title "Baz". +.TP +idle \-c "import sys; print sys.argv" "foo" +.PD +Open a shell window and run the command, passing "\-c" in sys.argv[0] +and "foo" in sys.argv[1]. +.TP +idle \-d \-s \-r foo.py "Hello World" +.PD +Open a shell window, run a startup script, enable the debugger, and +run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in +sys.argv[1]. +.TP +echo "import sys; print sys.argv" | idle - "foobar" +.PD +Open a shell window, run the script piped in, passing '' in sys.argv[0] +and "foobar" in sys.argv[1]. +.SH SEE ALSO +python(1). +.SH AUTHORS +Various. diff --git a/debian/idle.desktop b/debian/idle.desktop new file mode 100644 index 000000000000000..420e7e7b87029a0 --- /dev/null +++ b/debian/idle.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=IDLE +Comment=Integrated DeveLopment Environment for Python3 +Exec=/usr/bin/idle %F +TryExec=/usr/bin/idle +Icon=/usr/share/pixmaps/idle.xpm +Terminal=false +Type=Application +Categories=Application;Development; +StartupNotify=true +MimeType=text/x-python; diff --git a/debian/idle.lintian-overrides b/debian/idle.lintian-overrides new file mode 100644 index 000000000000000..112d2a6dcd3e646 --- /dev/null +++ b/debian/idle.lintian-overrides @@ -0,0 +1 @@ +menu-icon-missing diff --git a/debian/idle.py b/debian/idle.py new file mode 100755 index 000000000000000..ba0519b38d8b68f --- /dev/null +++ b/debian/idle.py @@ -0,0 +1,5 @@ +#! /usr/bin/python3 + +from idlelib.pyshell import main +if __name__ == '__main__': + main() diff --git a/debian/py3versions b/debian/py3versions new file mode 100755 index 000000000000000..b2f04a50fbe2c8b --- /dev/null +++ b/debian/py3versions @@ -0,0 +1,6 @@ +#! /usr/bin/python3 + +import sys +sys.path[0:0] = ['/usr/share/python3'] +import py3versions +py3versions.main() diff --git a/debian/py3versions.1 b/debian/py3versions.1 new file mode 100644 index 000000000000000..88b3c3f941081e8 --- /dev/null +++ b/debian/py3versions.1 @@ -0,0 +1,47 @@ +.TH PY3VERSIONS +.SH NAME +py3versions \- print python3 version information +.SH SYNOPSIS +.PP +.B py3versions +.I [-h] [-v] [] +.SH DESCRIPTION +.PP +.B py3versions +prints information about installed, supported python3 runtimes, the +default runtime, and parses the information of the PythonVersion +fields in the package control file for Python3. +.SH OPTIONS +.TP +.I -d, --default +Show the default python3 version. +.TP +.I -s, --supported +Show the supported python3 versions. List is lowest version to highest +version with the default version last (e.g. python3.4 python3.6 python3.5 if +python3.4, 3.5, and 3.6 are supported, but python3.5 is the default python3). +.TP +.I -r, --requested [|] +Reads the value of the +.B X-Python3-Version +field in the source section of a control file and shows all matching +python3 versions. The parameter is interpreted as a version string, if +it is not the name of a file. If the X-Python3-Version field is +missing, it will fall back to list the supported Python3 +versions after checking debian/control. Versions less than 3 are +ignored. The keyword all is ignored because it covers all Python2 +versions. The former keyword current is not supported at all in +Python3. Uses the same sort order as the -s, --supported option. +.TP +.I -i, --installed +Show the installed supported python3 versions. +.TP +.I -v, --version +Limit the output to the version numbers of the python3 versions. +.TP +.I -h, --help +Print a help text. +.SH SEE ALSO +Python policy. +.SH AUTHOR +Matthias Klose diff --git a/debian/py3versions.py b/debian/py3versions.py new file mode 100644 index 000000000000000..05783582187ef1b --- /dev/null +++ b/debian/py3versions.py @@ -0,0 +1,334 @@ +#! /usr/bin/python3 + +import os +import re +import sys + +_defaults = None +_old_versions = None +_unsupported_versions = None +_supported_versions = ["python%s" % ver.strip() for ver in + os.environ.get('DEBPYTHON3_SUPPORTED', '').split(',') + if ver.strip()] +#_default_version = "python%s" % os.environ.get('DEBPYTHON3_DEFAULT', '') +#if _default_version == 'python': +# _default_version = None +_default_version = None + + +def read_default(name=None): + global _defaults + from configparser import ConfigParser, NoOptionError + if not _defaults: + if os.path.exists('/usr/share/python3/debian_defaults'): + config = ConfigParser() + defaultsfile = open('/usr/share/python3/debian_defaults') + config.read_file(defaultsfile) + defaultsfile.close() + _defaults = config + + if _defaults and name: + try: + value = _defaults.get('DEFAULT', name) + except NoOptionError: + raise ValueError + return value + return None + + +def parse_versions(vstring): + if len(vstring.split(',')) > 2: + raise ValueError('too many arguments provided for X-Python3-Version: min and max only.') + import operator + operators = {None: operator.eq, '=': operator.eq, + '>=': operator.ge, '<=': operator.le, + '<<': operator.lt} + vinfo = {} + exact_versions = set() + version_range = set(supported_versions(version_only=True)) + relop_seen = False + for field in vstring.split(','): + field = field.strip() + if field == 'all': + continue + if field in ('current', 'current_ext'): + continue + vinfo.setdefault('versions', set()) + ve = re.compile(r'(>=|<=|<<|=)? *(\d\.\d)$') + m = ve.match(field) + try: + if not m: + raise ValueError('error parsing Python3-Version attribute') + op, v = m.group(1), m.group(2) + vmaj, vmin = v.split('.') + if int(vmaj) < 3: + continue + if op in (None, '='): + exact_versions.add(v) + else: + relop_seen = True + filtop = operators[op] + version_range = [av for av in version_range if filtop(av, v)] + except Exception: + raise ValueError('error parsing Python3-Version attribute') + if 'versions' in vinfo: + vinfo['versions'] = exact_versions + if relop_seen: + vinfo['versions'] = exact_versions.union(version_range) + return vinfo + + +def old_versions(version_only=False): + global _old_versions + if not _old_versions: + try: + value = read_default('old-versions') + _old_versions = [s.strip() for s in value.split(',')] + except ValueError: + _old_versions = [] + if version_only: + return [v[6:] for v in _old_versions] + else: + return _old_versions + + +def unsupported_versions(version_only=False): + global _unsupported_versions + if not _unsupported_versions: + try: + value = read_default('unsupported-versions') + _unsupported_versions = [s.strip() for s in value.split(',')] + except ValueError: + _unsupported_versions = [] + if version_only: + return [v[6:] for v in _unsupported_versions] + else: + return _unsupported_versions + + +def supported_versions(version_only=False): + global _supported_versions,_default_version + default_version() + if not _supported_versions: + try: + value = read_default('supported-versions') + _supported_versions = [s.strip() for s in value.split(',')] + except ValueError: + cmd = ['/usr/bin/apt-cache', '--no-all-versions', + 'show', 'python3-all'] + try: + import subprocess + p = subprocess.Popen(cmd, bufsize=1, + shell=False, stdout=subprocess.PIPE) + fd = p.stdout + except ImportError: + fd = os.popen(' '.join(cmd)) + depends = None + for line in fd: + if line.startswith('Depends:'): + depends = line.split(':', 1)[1].strip().split(',') + fd.close() + depends = [re.sub(r'\s*(\S+)[ (]?.*', r'\1', s) for s in depends] + _supported_versions = depends + default = _supported_versions.pop(_supported_versions.index(_default_version)) + _supported_versions.sort() + _supported_versions.append(default) + if version_only: + return [v[6:] for v in _supported_versions] + else: + return _supported_versions + + +def default_version(version_only=False): + global _default_version + if not _default_version: + _default_version = os.readlink('/usr/bin/python3') + # consistency check + debian_default = read_default('default-version') + if not _default_version in (debian_default, os.path.join('/usr/bin', debian_default)): + raise ValueError("the symlink /usr/bin/python3 does not point to the " + "python3 default version. It must be reset " + "to point to %s" % debian_default) + _default_version = debian_default + if version_only: + return _default_version[6:] + else: + return _default_version + + +def requested_versions(vstring, version_only=False): + global _default_version + default_version() + versions = None + vinfo = parse_versions(vstring) + supported = supported_versions(version_only=True) + if len(vinfo) == 1: + versions = vinfo['versions'].intersection(supported) + vl = [] + for version in versions: vl.append(version) + try: + default = vl.pop(vl.index(_default_version[6:])) + except: + default = '' + vl.sort() + if default: + vl.append(default) + else: + raise ValueError('No supported python3 versions in version string') + if not versions: + raise ValueError('empty set of versions') + if version_only: + return vl + else: + return ['python%s' % v for v in vl] + + +def installed_versions(version_only=False): + import glob + supported = supported_versions() + versions = [os.path.basename(s) + for s in glob.glob('/usr/bin/python3.[0-9]') + if os.path.basename(s) in supported] + versions.sort() + if version_only: + return [v[6:] for v in versions] + else: + return versions + + +class ControlFileValueError(ValueError): + pass + + +class MissingVersionValueError(ValueError): + pass + + +def extract_pyversion_attribute(fn, pkg): + """read the debian/control file, extract the X-Python3-Version + field.""" + + version = None + sversion = None + section = None + with open(fn, encoding='utf-8') as controlfile: + lines = [line.strip() for line in controlfile] + for line in lines: + if line == '' and section != None: + if pkg == 'Source': + break + section = None + elif line.startswith('Source:'): + section = 'Source' + elif line.startswith('Package: ' + pkg): + section = pkg + elif line.lower().startswith('x-python3-version:'): + if section != 'Source': + raise ValueError('attribute X-Python3-Version not in Source section') + sversion = line.split(':', 1)[1].strip() + if section is None: + raise ControlFileValueError('not a control file') + if pkg == 'Source': + if sversion is None: + raise MissingVersionValueError('no X-Python3-Version in control file') + return sversion + return version + + +''' +def requested_versions_bis(vstring, version_only=False): + versions = [] + py_supported_short = supported_versions(version_only=True) + for item in vstring.split(','): + v=item.split('-') + if len(v)>1: + if not v[0]: + v[0] = py_supported_short[0] + if not v[1]: + v[1] = py_supported_short[-1] + for ver in py_supported_short: + try: + if version_cmp(ver,v[0]) >= 0 \ + and version_cmp(ver,v[1]) <= 0: + versions.append(ver) + except ValueError: + pass + else: + if v[0] in py_supported_short: + versions.append(v[0]) + versions.sort(version_cmp) + if not versions: + raise ValueError('empty set of versions') + if not version_only: + versions=['python'+i for i in versions] + return versions +''' + + +def main(): + from optparse import OptionParser + usage = '[-v] [-h] [-d|--default] [-s|--supported] [-i|--installed] ' + '[-r|--requested |]' + parser = OptionParser(usage=usage) + parser.add_option('-d', '--default', + help='print the default python3 version', + action='store_true', dest='default') + parser.add_option('-s', '--supported', + help='print the supported python3 versions', + action='store_true', dest='supported') + parser.add_option('-r', '--requested', + help='print the python3 versions requested by a build; ' + 'the argument is either the name of a control file ' + 'or the value of the X-Python3-Version attribute', + action='store_true', dest='requested') + parser.add_option('-i', '--installed', + help='print the installed supported python3 versions', + action='store_true', dest='installed') + parser.add_option('-v', '--version', + help='print just the version number(s)', + default=False, action='store_true', dest='version_only') + opts, args = parser.parse_args() + program = os.path.basename(sys.argv[0]) + + if opts.default and len(args) == 0: + try: + print(default_version(opts.version_only)) + except ValueError as msg: + print("%s:" % program, msg) + sys.exit(1) + elif opts.supported and len(args) == 0: + print(' '.join(supported_versions(opts.version_only))) + elif opts.installed and len(args) == 0: + print(' '.join(installed_versions(opts.version_only))) + elif opts.requested and len(args) <= 1: + if len(args) == 0: + versions = 'debian/control' + else: + versions = args[0] + try: + if os.path.isfile(versions): + fn = versions + try: + vstring = extract_pyversion_attribute(fn, 'Source') + vs = requested_versions(vstring, opts.version_only) + except ControlFileValueError: + sys.stderr.write("%s: not a control file: %s, " + % (program, fn)) + sys.exit(1) + except MissingVersionValueError: + sys.stderr.write("%s: no X-Python3-Version in control " + "file, using supported versions\n" % + program) + vs = supported_versions(opts.version_only) + else: + vs = requested_versions(versions, opts.version_only) + print(' '.join(vs)) + except ValueError as msg: + sys.stderr.write("%s: %s\n" % (program, msg)) + sys.exit(1) + else: + sys.stderr.write("usage: %s %s\n" % (program, usage)) + sys.exit(1) + +if __name__ == '__main__': + main() diff --git a/debian/python-policy.dbk b/debian/python-policy.dbk new file mode 100644 index 000000000000000..42051b3b20804d0 --- /dev/null +++ b/debian/python-policy.dbk @@ -0,0 +1,1163 @@ + + + + + Debian Python Policy + + Neil Schemenauer + nas@debian.org + + + Matthias Klose + doko@debian.org + + + Gregor Hoffleit + flight@debian.org + + + Josselin Mouette + joss@debian.org + + + Joe Wreschnig + piman@debian.org + + + Loïc Minier + lool@debian.org + + + Scott Kitterman + scott@kitterman.com + + + Barry Warsaw + barry@debian.org + + + Ben Finney + ben+debian@benfinney.id.au + + version 0.10.1.1 + + + This document describes the packaging of Python within the + Debian GNU/Linux distribution and the policy requirements for + packaged Python programs and modules. + + + 1999 2016Software in the Public Interest + + + This manual is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. + + + This is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + + A copy of the GNU General Public License version 2 is available as + /usr/share/common-licences/GPL-2 in the Debian + GNU/Linux system, or on the World Wide Web at + GNU General Public License, version 2. + + + You can also obtain it by writing to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. + + + + On the move to Python 3 + + Debian currently supports two Python stacks, one for Python 3 + and one for Python 2. The long term goal for Debian is to + reduce this to one stack, dropping the Python 2 stack at some + time. + + + PEP 404 states that no more major Python 2 releases + are planned, although the latest released minor version 2.7 + will see some extended support, documented in + PEP 466. + + + Packages in Debian should use Python 3 if Python 3 is + supported. New packages should use Python 3 from the initial + upload, new upstream versions for existing packages should + use Python 3 if the new upstream version supports it. + + + + + + Programs should use Python 3, and should not be packaged + for Python 2 as well. Python 3 should be used for the + packaging if the packaging scripts use Python. + + + + + Python libraries, if they support Python 3, should be always + packaged for Python 3. If an application supports only Python + 2, the Python libraries for that application should also be + packaged for Python 2. + + + + + Existing Python 2 libraries should not be dropped before + the last reverse dependency is removed. + + + + + + + + Python Packaging +
+ Versions + + At any given time, the binary package python3 + will represent the current default Debian Python 3 version; the + binary package python will represent the + current default Debian Python 2 version. As far as is reasonable, + Python 3 and Python 2 should be treated as separate runtime + systems with minimal interdependencies. + + + In some cases, Python policy explicitly references Python helper + tools. For Debian Stretch, the dh-python + package provides the only such tools; earlier helpers have been + removed from Debian. + + + It is a design goal to fully specify required interfaces and + functions in policy for Python 3 and to avoid enshrining specific + implementation details in policy. Except as noted, policy for + Python 2 is the same as Python 3 with the exception of the + different major version number as needed to distinguish them. + + + The default Debian Python version, for each of Python 3 and Python + 2, should always be the latest stable upstream version that can be + fully integrated in Debian. + + + There may be newer supported or unsupported versions included in + Debian if they are not fully integrated for a particular release. + + + Apart from the default version, legacy versions of Python or beta + releases of future upstream versions may be included as well in + Debian, as long as they are needed by other packages, or as long + as it seems reasonable to provide them. + + + Note: For the scope of this document, a Python version is + synonymous with all micro versions within that minor version. e.g. + Python 3.5.0 and 3.5.1 are micro versions of the same Python + version 3.5, but Python 3.4 and 3.5 are indeed different versions. + + + For any version, the main binary package must be called + pythonX.Y. + + + + The set of currently supported Python 3 versions can be found + in /usr/share/python3/debian_defaults; the supported + interface to this information is + through /usr/bin/py3versions. + The set of currently supported Python 2 versions can be found in + /usr/share/python/debian_defaults; the supported + interface to this information is /usr/bin/pyversions. + + + These files are in Python configparser format. They + define (in the DEFAULT section) the following options: + + default-version: The name of the interpreter for + the current default Debian Python. + supported-versions: The set of interpreter names + currently supported and for which modules should be built and + byte-compiled. This includes default-version. + old-versions: The set of interpreter names which + might still be on the system but for which modules should not + be built. + unsupported-versions: The set of interpreter + names which should not be supported at all, that is modules + should not be built or byte-compiled for these. This includes + (is a superset of) old-versions. + + + + Newer versions might also appear in unsupported-versions + before being moved to supported-versions. + + +
+ +
+ Main packages + + For every Python version provided in Debian, the binary + package pythonX.Y shall + provide a complete distribution for deployment of Python + scripts and applications. The package must ensure that the binary + /usr/bin/pythonX.Y is provided. + + + Installation of pythonX.Y + shall provide the modules of the upstream Python distribution with + some exceptions. + + + Excluded are modules that cannot be included for licensing reasons + (for example the profile module), for dependency tracking + purposes (for example the GPL-licensed gdbm module), or + that should not be included for packaging reasons (for example + the tk module which depends on Xorg). + + + Some tools and files for the development of Python + modules are split off in a separate binary package + pythonX.Y-dev. + + + Documentation will be provided separately as well. + + + At any time, the python3 binary package must + ensure that /usr/bin/python3 is provided, as a + symlink to the current python3.Y + executable. The package must depend on + the python3.Y package that installs + the executable. + + + The version of the python3 package must be + greater than or equal to 3.Y and lower than + 3.Y+1. + + + At any time, the python binary package must + ensure that /usr/bin/python2 is provided, as a + symlink to the current python2.Y + executable. The package must depend on + the python2.Y package that installs + the executable. + + + The version of the python package must be + greater than or equal to 2.Y and lower than + 2.Y+1. + + + The python binary package must also ensure + that /usr/bin/python is provided, as a symlink to the + current python2.Y executable. See + PEP 394 for details. + +
+ +
+ Minimal packages + + For every Python version provided in Debian, the binary package + pythonX.Y-minimal might + exist and should not be depended upon by other packages except the + Python runtime packages themselves. + +
+ +
+ Python Interpreter +
+ Interpreter Name + + The different Python major versions require different + interpreters (see ). + + + Python scripts that require the default Python 3 version should + specify python3 as the interpreter name. + + + Python scripts that require the default Python 2 version should + specify python2 as the interpreter name. + + + Python scripts may specify python as the + interpreter name only if they do not require any particular + version of Python. (Note: this means any python2 version) + + + Python scripts that only work with a specific Python minor + version must explicitly use the versioned interpreter name + (pythonX.Y). + +
+
+ Interpreter Location + + Python scripts should specify the Debian Python interpreter, to + ensure that the Debian Python installation is used and all + dependencies on additional Python modules are met. + + + The preferred specification for the Python 3 interpreter is + /usr/bin/python3 (or + /usr/bin/python3.Y if it requires Python + 3.Y). + + + The preferred specification for the Python 2 interpreter is + /usr/bin/python2 (or + /usr/bin/python2.Y if it requires Python + 2.Y). + + + Scripts requiring the default Python 2 version may instead + specify the interpreter /usr/bin/python. + + + Maintainers should not override the Debian Python interpreter + using /usr/bin/env name. This is not + advisable as it bypasses Debian's dependency checking and makes + the package vulnerable to incomplete local installations of + Python. + +
+
+ +
+ Module Path + + By default, Python modules are searched in the directories listed + in the PYTHONPATH environment variable and in + the sys.path Python variable. For all supported Debian + releases, sys.path does not include + a /usr/lib/pythonXY.zip entry. + + + Directories with private Python modules must be absent from the + sys.path. + + + Public Python 3 modules must be installed in the system Python 3 + modules directory, /usr/lib/python3/dist-packages. + + + Public Python 2 modules must be installed in the system Python 2 + modules directory + /usr/lib/python2.Y/dist-packages, where + 2.Y is the Python 2 version. + + + A special directory is dedicated to public Python modules + installed by the local administrator, + /usr/lib/python3/dist-packages for all Python 3 versions, + /usr/local/lib/python2.Y/dist-packages for + Python 2. + + + For local installation of Python modules by the system + administrator, special directories are reserved. The + directory /usr/local/lib/python3/site-packages is in + the Python 3 runtime module search path. The + directory /usr/local/lib/python2.Y/site-packages + is in the Python 2.Y runtime module search path. + + + Additional information on appending site-specific paths to the + module search path is available in the official documentation of + the site module. + + + Python modules which work with multiple supported Python 2 + versions must install to version-specific locations, for instance + /usr/lib/python2.6/dist-packages/foo.py and + /usr/lib/python2.7/dist-packages/foo.py. These should + point to a common file. + + + Architecture-independent public Python 3 modules must be installed + to /usr/lib/python3/dist-packages. + + + Architecture-independent public Python 2 modules should be + installed to /usr/lib/python2.7/dist-packages. The + historical location for this was /usr/share/pyshared. + Since Python 2.7 is the last Python 2 version and the only + supported version in Wheezy and later releases, a version-specific + location is sufficient. + +
+ +
+ Hooks for updates to installed runtimes + + The python binary package has special hooks to + allow other packages to act upon updates to the installed + runtimes. + + + This mechanism is required to handle changes of the default Python + runtime in some packages and to enable the Python packaging + helpers. + + + There are three supported hook types which come in the form of + scripts which are invoked from the maintainer scripts of the + Python runtime packages when specific installations, + removals, or upgrades occur. + + + + + /usr/share/python3/runtime.d/*.rtinstall, + /usr/share/python/runtime.d/*.rtinstall: These + are called when a runtime is installed or becomes supported. + The first argument is rtinstall, the second argument + is the affected runtime (for + example pythonX.Y) and the + third and fourth argument are the old and new version of this + packaged runtime if this runtime was already installed but + unsupported. + + + + + /usr/share/python3/runtime.d/*.rtremove, + /usr/share/python/runtime.d/*.rtremove: These are + called when a runtime is removed or stops being supported. The + first argument is rtremove, and the second argument + is the affected runtime (for + example pythonX.Y). + + + + + /usr/share/python3/runtime.d/*.rtupdate, + /usr/share/python/runtime.d/*.rtupdate: These are + called when the default runtime changes. The first argument is + either pre-rtupdate, called before changing the + default runtime, or rtupdate, called when changing + the default runtime, or post-rtupdate, called + immediately afterwards. The second argument is the old default + runtime (for + example pythonX.Y), and the + third argument is the new default runtime (for example + pythonX.Z). + + + +
+ +
+ Documentation + + Python documentation is split out in separate binary packages + pythonX.Y-doc. + + + The binary package python3-doc will always + provide the documentation for the default Debian Python 3 version. + The binary package python-doc will always + provide the documentation for the default Debian Python 2 version. + + + TODO: Policy for documentation of third party packages. + +
+
+ + + Packaged Modules + + The goal of these policies is to reduce the work necessary for + Python transitions. Python modules are internally very dependent on + a specific Python version. However, we want to automate recompiling + modules when possible, either during the upgrade itself + (re-compiling bytecode files *.pyc + and *.pyo) or shortly thereafter with automated + rebuilds (to handle C extensions). These policies encourage + automated dependency generation and loose version bounds whenever + possible. + +
+ Types of Python Modules + + There are two kinds of Python modules, "pure" Python + modules, and extension modules. Pure Python modules are + Python source code that generally works across many versions of + Python. Extensions are C code compiled and linked against a + specific version of the Python runtime, and so can only + be used by one version of Python. + + + Debian Python does not link extensions to libpython + (as is done in some operating systems). Symbols are resolved by + /usr/bin/pythonX.Y which is not + linked to libpython. + + + Python packages are a way of structuring Python’s module namespace + by using “dotted module names”. See + Python's glossary for details on how packages are defined + in Python terms (a package in the Python sense is unrelated to a + Debian package). Python packages must be packaged into the same + directory (as done by upstream). Splitting components of a package + across directories changes the import order and may confuse + documentation tools and IDEs. + + + There are two ways to distribute Python modules. Public modules + are installed in a public directory as listed in . + They are accessible to any program. Private modules are installed + in a private directory such + as /usr/share/package-name + or /usr/lib/package-name. They are + generally only accessible to a specific program or suite of + programs included in the same package. + +
+
+ Wheels + + PEP 427 + defines a built-package format called "wheels", which is a Zip + format archive containing Python code and + a *.dist-info metadata directory, in a single file + named with the .whl suffix. As Zip files, wheels + containing pure Python can be put on sys.path and modules in the + wheel can be imported directly by Python's import + statement. (Importing extension modules from wheels is not yet + supported as of Python 3.4.) + + + Except as described below, packages must not build or provide + wheels. They are redundant to the established way of providing + Python libraries to Debian users, take no advantage of + distro-based tools, and are less convenient to use. E.g. they must + be explicitly added to sys.path, cannot be easily + grepped, and stack traces through Zip files are more difficult to + debug. + + + A very limited set of wheel packages are available in the archive, + but these support the narrow purpose of enabling + the pip, virtualenv, + and pyvenv tools in a Debian policy compliant way. + These packages build their own dependent wheels through the use of + the dirtbike "rewheeling" tool, which takes installed + Debian packages and turns them back into wheels. Only universal + wheels (i.e. pure-Python, Python 3 and 2 compatible packages) are + supported. Since only the programs that require wheels need build + them, only they may provide -whl packages, + e.g. python3-pip-whl. + + + When these binary packages are installed, *.whl files + must be placed in the /usr/share/python-wheels + directory. The location inside a virtual environment will be + rooted in the virtual environment, instead of /usr. + +
+
+ Module Package Names + + Public Python modules must be packages separately by major Python + version, to preserve run time separation between Python 2 and + Python 3. + + + Public Python 3 modules used by other packages must have their + binary package name prefixed with python3-. + Public Python 2 modules used by other packages must have their + binary package name prefixed with python-. + It is recommended to use this prefix for all packages with public + modules as they may be used by other packages in the future. + + + The binary package for module foo should preferably be + named python3-foo (for Python 3) + or python-foo (for Python 2), if the + module name allows. This is not required if the binary package + installs multiple modules, in which case the maintainer shall + choose the name of the module which best represents the package. + + + For subpackages such as foo.bar, the recommendation is + to name the binary + package python3-foo.bar (for Python + 3) or python-foo.bar (for Python 2). + + + Such a package should support the current Debian Python version, + and more if possible (there are several tools to help implement + this, see ). For example, if Python 3.3, + 3.4, and 3.5 are supported, the Python statement + +import foo + + should import the module when the program interpreter is any + of /usr/bin/python3.3, /usr/bin/python3.4, + and /usr/bin/python3.5. This requirement also applies + to extension modules; binaries for all the supported Python + versions should be included in a single package. + + + Packages intended for use with Django (python3-django/ + python-django) are installed in the same namespace as + other python packages for a variety of reasons. Many such packages are + named django_$name upstream. These are then packaged as + python3-django-$name and + python-django-$name. + This makes it clear that they are intended for use with Django + and not general purpose Python modules. Debian maintainers are + encouraged to work with their upstreams to support consistent use of + this approach. + +
+
+ Specifying Supported Versions + + The debian/control source paragraph may contain + optional fields to specify the versions of Python the package + supports. + + + The optional X-Python3-Version field specifies the + versions of Python 3 supported. When not specified, it defaults to + all currently supported Python 3 versions. + + + Similarly, the optional fields X-Python-Version + or XS-Python-Version were used to specify the versions of + Python 2 supported by the source package. They are obsolete and + can be removed now that only Python 2.7 is supported. + + + These fields are used by some packaging scripts to automatically + generate appropriate Depends and Provides lines. The format of the + field may be one of the following: + +X-Python3-Version: >= X.Y +X-Python3-Version: >= A.B, << X.Y +XS-Python-Version: A.B, X.Y +XS-Python-Version: all + + + + The keyword all means that the package supports any + Python 2 version available but might be deprecated in the future + since using version numbers is clearer than all and + encodes more information. The keyword all is limited to + Python 2 versions and must be ignored for Python 3 versions. + + + A comma-separated list of multiple individual versions + (e.g. 3.3, 3.4, 3.5) in XS-Python-Version will + continue to be supported, but is not recommended. The use of + multiple individual versions in X-Python-Version + or X-Python3-Version is not supported for Wheezy and + later releases. + + + The keyword current has been deprecated and used to mean + that the package would only have to support a single Python 2 + version (even across default version changes). It must be ignored + for Python 3 versions. + + + The use of XB-Python-Version in the binary package + paragraphs of debian/control file has been deprecated + and should be removed in the normal course of package updates. It + never achieved sufficient deployment to support its intended + purpose of managing Python transitions. This purpose can be + adequately accomplished by examining package dependencies. + +
+ +
+ Dependencies + + Any package that installs modules for the default Python version + (or many versions including the default) as described + in , must declare a dependency on the + default Python runtime package. If it requires other modules to + work, the package must declare dependencies on the corresponding + packaged modules. The package must not declare dependency on any + version-specific Python runtime or module package. + + + For Python 3, the correct dependencies are Depends: + python3 (>= 3.Y) and any + corresponding python3-foo packages. + + + For Python 2, the correct dependencies are Depends: + python (>= 2.Y) and any + corresponding python-foo packages. + + + Any package that installs Python modules or Python 3 binary + extensions must also declare a maximum version it supports as + currently built. This is accomplished by declaring a maximum + version constraint strictly less than one higher than the current + maximum version, i.e. Depends: + python3 (<< X.Y). + +
+ +
+ Provides + + Binary packages that declare Provides dependencies of the form + pythonX.Y-foo + were never supported for Python 3 and are no longer useful for + Python 2. They should be removed in the normal course of package + updates. Future provision of values for the substituation variable + python:Provides is not guaranteed. + +
+ +
+ Modules Byte-Compilation + + If a binary package provides any binary-independent modules + (foo.py files), the corresponding + byte-compiled modules (foo.pyc files) and + optimized modules (foo.pyo files) must not + ship in the package. Instead, they should be generated in the + package's post-install script, and removed in the package's + pre-remove script. The package's prerm has to make sure that + both foo.pyc and + foo.pyo are removed. + + + A binary package should only byte-compile the files which belong to + the package. + + + The file /etc/python/debian_config allows + configuration how modules should be byte-compiled. The + post-install scripts should respect these settings. + + + Pure Python modules in private installation directories that are + byte-compiled with the default Python version must be forcefully + byte-compiled again when the default Python version changes. + + + Public Python extensions should be bin-NMUed. + + + Private Python extensions should be subject to binary NMUs every + time the default interpreter changes, unless the extension is + updated through a *.rtupdate script. + +
+
+ + + Python Programs + +
+ Interpreter directive (“Shebang”) + + Executables written for interpretation by Python must use an + appropraite interpreter directive, or “shebang”, as the first line + of the program. This line should be of the + form #!interpreter_location. + See for the interpreter name to use. + + + As noted in , the + form #!/usr/bin/env interpreter_name is + deprecated. + +
+ +
+ Programs using the default Python + + A package that installs a program that can be run by any version + of Python 3 must declare a dependency + on python3, with a versioned dependency if + necessary. + + + A package that installs a program that can be run by any version + of Python 2 must declare a dependency + on python2, with a versioned dependency if + necessary. + + + If the program needs the public Python module foo, the + package must depend on the binary package that installs + the foo module. See for the + naming of packages that install public Python modules. + + +
+ Programs Shipping Private Modules + + A program that specifies python3 + or python as its interpreter may require its own + private Python modules. These modules should be installed + in /usr/share/module, or + /usr/lib/module if the modules are + architecture-dependent (e.g. extensions). + + + The rules explained in apply to + those private modules: the byte-compiled modules must not be + shipped with the binary package, they should be generated in the + package's post-install script using the current default Python + version, and removed in the pre-remove script. Modules should be + byte-compiled using the current default Python version. + + + Programs that have private compiled extensions must either + handle multiple version support themselves, or declare a tight + dependency on the current Python version (e.g. Depends: + python3 (>= 3.5), + python3 (<< 3.6). + +
+
+ +
+ Programs Using a Particular Python Version + + A program which requires a specific minor version of Python must + specify the versioned + interpreter pythonX.Y. The + package that installs the programs must also specify a dependency + on + pythonX.Y and on any + packages that install necessary modules. + + + The notes on installation directories and byte-compilation + for programs that support any version of Python also apply + to programs supporting only a single Python version. Modules + to be byte-compiled should use the same Python version as the + package itself. + +
+
+ + + Programs Embedding Python + +
+ Building Embedded Programs + + Any package that installs a program which embeds a Python + interpreter must declare Build-Depends on + pythonX.Y-dev, where + X.Y is the Python version the program + builds against. It should be the current default Python version + unless the program does not work correctly with this version. + +
+ +
+ Embedded Python Dependencies + + Dependencies for programs linking against the shared Python + library will be automatically created + by dpkg-shlibdeps. The + libpythonX.Y.so.Z + library the program is built against is provided by the + pythonX.Y package. + +
+
+ + + Interaction with Locally Installed Python Versions + + As long as you don't install other versions of Python in your + path, Debian's Python versions won't be affected by a new + version. + + + If you install a different micro version of the version of Python + you have got installed, you will need to be careful to install all + the modules you use for that version of Python too. + + + + + + Build Dependencies + + Build dependencies for Python-dependent packages must be declared + for every Python version that the package is built for. + + + The python3-all-dev should be used when building + extensions for any or all Python 3 versions. + The python-all-dev should be used when building + extensions for any or all Python 2 versions. To build for a specific + version or versions, declare Build-Depends on + pythonX.Y-dev. + + + Some applications and pure Python modules may be able to avoid + dependency on the -dev packages, and declare + Build-Depends on the runtime environment only + (python3, python3-all, + python, python-all). A package + that does not require the -dev packages must not + declare Build-Depends on them. + + + + Declare Build-Depends on at least: + +Build-Depends: python2.7 +Build-Depends: python2.6 (>= 2.6-1) +Build-Depends: python (>= 2.6.6-9) +Build-Depends: python-all + +Build-Depends: python2.7-dev +Build-Depends: python3.5-dev (>= 3.5.1-1) +Build-Depends: python-dev (>= 2.6.6-9) +Build-Depends: python-all-dev +Build-Depends: python3-all-dev (>= 3.2) + + + + + + Packaging Tools + + This section describes the various tools to help package + Python programs and modules for Debian. Although none of these + tools are mandatory, their use is strongly encouraged, as the + above policy has been designed with them in mind (and vice + versa). This appendix is just an overview. If you use these + tools, you should read their full documentation. + +
+ distutils + + The standard Python distutils module has been modified in + Debian to change the default installation directory of public + Python modules and to add a new flag to the install + command to override the default, --install-layout=. + + + Public Python modules installed with a modified distutils default + to + /usr/local/lib/pythonX.Y/dist-packages + for Python 2.6 and later. This directory is seen by the + system-provided Python 2.6. + + + When using a local Python installation, the default is + /usr/local/lib/pythonX.Y/site-packages + which is only seen by the local Python installation. + + + Using the --install-layout=deb flag to + the install command of setup.py with a + system-provided Python 2.6 or later versions, Python modules will + be installed to + /usr/lib/pythonX.Y/dist-packages + which is only seen by the system-provided Python, not by a local + installation. + +
+ +
+ setuptools + + The related Python setuptools module has been modified in + Debian along the same lines as distutils. + + + Upstream focus on developments and improvements for Python packaging + tools has largely shifted away from distutils and to + setuptools. They offer a similar API and at some point in + the future, setuptools may fully replace distutils + in Debian package builds. + +
+ +
+ <literal>dh-python</literal> + + dh-python provides extensions + for debhelper to make it easier to package + Python modules and extensions. They calculate Python dependencies, + add maintainer scripts to byte compile files, etc. Their use is + not mandatory, but they are recommended by the Debian Python + maintainers. + + + See man dh_python3 or man dh_python2 for + details. + +
+ +
+ pybuild + + Pybuild is a Debian Python specific build system that invokes + various build systems for requested Python versions in order to + build modules and extensions. It supports automatically building + for multiple Python versions. + +
+ +
+ CDBS + + The CDBS python-distutils.mk class helps packaging of + distutils based Python packages. + +
+ +
+ <literal>python-support</literal> (removed) + + python-support provided another way to manage + Python modules. It has been removed from Debian Stretch and later + releases. + +
+ +
+ <literal>python-central</literal> (removed) + + python-central provided another way to manage + Python modules. It has been removed from Debian Jessie and later + releases. + +
+ +
+ + + Upgrade Procedure + + This section describes the procedure for the upgrade when the + default Python version is changed in the Debian unstable + release, requiring recompilation of many Python-related packages. + + + + + + Selected pre-releases and release candidates of new Python + versions are uploaded to Debian experimental to + support pre-transition work and testing. + + + + + Application and module maintainers make sourceful changes + where needed to prepare for the new Python version when + needed. + + + + + Have a long and heated discussion. + + + + + The Debian Python maintainer and module/application + maintainers discuss the readiness for a new default Debian + Python version and associated packaging/policy changes. Once + there is some consensus, the Python maintainer announces the + upgrade and uploads to unstable. + + + + + Upload of the Python core meta-packages python, + python-dev, python-doc and + several python-module, depending on + the new pythonX.Y, + pythonX.Y-dev and so on. + + + + + The Debian release team schedules rebuilds for packages that + may need it. Packages that require additional manual work get + updated and uploaded. + + + + + + The necessary package builds are typcially done in three phases in + order to keep transitions as smooth as possible. For Python 3, there + is no general need to update architecture all packages for a new + Python 3 version. Only architecture any packages need to be rebuilt. + + + + The new Python 3 version is added to supported versions and + packages that support multiple Python 3 versions are binNMUed. + They now support both the new and older Python 3 versions. + This requires transition assistance from the release team in + the form of a transition tracker and binNMU scheduling, but is + not a transition that can cause entanglements with other + transitions in Debian. + + + + + Once the default Python 3 version is changed, binNMUs are done + for packages that only support one Python 3 version. Some + transient uninstallability is unavoidable. This is a + transition that can entangle other transitions in Debian and + requires more careful coordination with the release team. + + + + + After the old Python 3 version is dropped from supported + versions then packages with multi-version support are binNMUed + again to remove support for the old Python 3 version. This is + not a true transition and only needs a tracker and binNMU + scheduling. + + + + + +
+ + diff --git a/debian/python.doc-base.python-policy b/debian/python.doc-base.python-policy new file mode 100644 index 000000000000000..100c5a725c3a915 --- /dev/null +++ b/debian/python.doc-base.python-policy @@ -0,0 +1,19 @@ +Document: python-policy +Title: Debian Python Policy (Proposal) +Author: Neil Schemenauer, Matthias Klose, Gregor Hoffleit +Abstract: This document describes the packaging of Python within the Debian + GNU/Linux distribution and the policy requirements for packaged Python + programs and modules. + . + The Debian Python Policy has still a draft status. +Section: Debian + +Format: docbook-xml +Files: /usr/share/doc/python/python-policy.dbk.gz + +Format: text +Files: /usr/share/doc/python/python-policy.txt.gz + +Format: HTML +Index: /usr/share/doc/python/python-policy.html/index.html +Files: /usr/share/doc/python/python-policy.html/*.html diff --git a/debian/python.mk b/debian/python.mk new file mode 100644 index 000000000000000..15e779925c8b621 --- /dev/null +++ b/debian/python.mk @@ -0,0 +1,46 @@ +# some macros useful for packaging python packages + +# to include it unconditionally: +# include /usr/share/python3/python.mk +# +# to include it conditionally, and have the packaging working with earlier releases +# and backports: +# -include /usr/share/python/python.mk +# ifeq (,$(py_sitename)) +# py_sitename = site-packages +# py_libdir = /usr/lib/python$(subst python,,$(1))/site-packages +# py_sitename_sh = $(py_sitename) +# py_libdir_sh = $(py_libdir) +# endif + +# py_sitename: name of the site-packages/dist-packages directory depending +# on the python version. Call as: $(call py_sitename, ). +# Don't use this in shell snippets inside loops. + +py_sitename = $(if $(filter $(subst python,,$(1)), 2.3 2.4 2.5),site,dist)-packages + +# py_libdir: absolute path to the default python library for third party +# stuff. Call as: $(call py_libdir, ). +# Don't use this in shell snippets inside loops. + +py_libdir = /usr/lib/python$(strip $(if $(findstring 3.,$(subst python,,$(1))),3,$(subst python,,$(1))))/$(py_sitename) + +# py_pkgname: package name corresponding to the python version. +# Call as: $(call py_pkgname, , ). + +py_pkgname = $(if $(findstring 3.,$(2)),$(subst python-,python3-,$(1)),$(1)) + +# distutils' build directory +py_builddir = $(shell python$(strip $(subst python,,$(1))) -c 'from distutils.command.build import build; from distutils.core import Distribution; b = build(Distribution()); b.finalize_options(); print(b.build_platlib)') + + +# The same macros for use inside loops in shell snippets + +py_sitename_sh = $$(basename $$(_py_=$(strip $(1)); python$${_py_\#python*} -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())')) + +py_libdir_sh = $$(_py_=$(strip $(1)); python$${_py_\#python*} -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())') + +py_builddir_sh = $$(_py_=$(strip $(1)); python$${_py_\#python*} -c 'from distutils.command.build import build; from distutils.core import Distribution; b = build(Distribution()); b.finalize_options(); print(b.build_platlib)') + +# Arguments to pass to setup.py install +py_setup_install_args = --install-layout=deb diff --git a/debian/python3-minimal.manpages b/debian/python3-minimal.manpages new file mode 100644 index 000000000000000..fa9104ee130426d --- /dev/null +++ b/debian/python3-minimal.manpages @@ -0,0 +1,2 @@ +py3clean.1 +py3compile.1 diff --git a/debian/python3-minimal.postinst.in b/debian/python3-minimal.postinst.in new file mode 100644 index 000000000000000..a7e55a7f194eb63 --- /dev/null +++ b/debian/python3-minimal.postinst.in @@ -0,0 +1,8 @@ +#! /bin/sh +set -e + +if which py3compile >/dev/null 2>&1; then + py3compile -p python3-minimal /usr/share/python3/ +fi + +#DEBHELPER# diff --git a/debian/python3-minimal.prerm b/debian/python3-minimal.prerm new file mode 100644 index 000000000000000..fc276a88f6dc1e2 --- /dev/null +++ b/debian/python3-minimal.prerm @@ -0,0 +1,7 @@ +#! /bin/sh +set -e + +rm -rf /usr/share/python3/__pycache__ +rm -rf /usr/share/python3/debpython/__pycache__ + +#DEBHELPER# diff --git a/debian/python3.desktop b/debian/python3.desktop new file mode 100644 index 000000000000000..2e6829c8ee2a0e6 --- /dev/null +++ b/debian/python3.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=KonsoleApplication +Name=Python3 Interpreter +Comment=Python3 +Exec=/usr/bin/python3 +Icon=/usr/share/pixmaps/python3.xpm diff --git a/debian/python3.lintian-overrides b/debian/python3.lintian-overrides new file mode 100644 index 000000000000000..e4c9c0e38e86f9c --- /dev/null +++ b/debian/python3.lintian-overrides @@ -0,0 +1,2 @@ +# this is the only package that can depend on it +python3 binary: depends-on-python-minimal diff --git a/debian/python3.postinst.in b/debian/python3.postinst.in new file mode 100644 index 000000000000000..029026993004ba4 --- /dev/null +++ b/debian/python3.postinst.in @@ -0,0 +1,50 @@ +#! /bin/sh +set -e + +new_config_file() +{ + cat > /etc/python3/debian_config <<-EOF + [DEFAULT] + # how to byte-compile (comma separated: standard, optimize) + byte-compile = standard + EOF +} + +case "$1" in + configure) + [ -d /etc/python3 ] || mkdir /etc/python3 + [ -f /etc/python3/debian_config ] || new_config_file + + oldv=$(echo $2 | sed 's/^\(...\).*/\1/') + if [ "$DEBIAN_FRONTEND" != noninteractive ]; then + echo "running python rtupdate hooks for @PVER@..." + fi + for hook in /usr/share/python3/runtime.d/*.rtupdate; do + [ -x $hook ] || continue + if ! $hook rtupdate python$oldv @PVER@; then + hb=$(basename $hook .rtupdate) + echo >&2 "error running python rtupdate hook $hb" + errors=yes + fi + done + [ -z "$errors" ] || exit 4 + + if [ "$DEBIAN_FRONTEND" != noninteractive ]; then + echo "running python post-rtupdate hooks for @PVER@..." + fi + for hook in /usr/share/python3/runtime.d/*.rtupdate; do + [ -x $hook ] || continue + if ! $hook post-rtupdate python$oldv @PVER@; then + hb=$(basename $hook .rtupdate) + echo >&2 "error running python post-rtupdate hook $hb" + errors=yes + fi + done + [ -z "$errors" ] || exit 5 +esac + +if which py3compile >/dev/null 2>&1; then + py3compile -p python3 /usr/share/python3/ +fi + +#DEBHELPER# diff --git a/debian/python3.postrm.in b/debian/python3.postrm.in new file mode 100644 index 000000000000000..c51b8c12ceff63b --- /dev/null +++ b/debian/python3.postrm.in @@ -0,0 +1,9 @@ +#! /bin/sh +set -e + +case "$1" in + purge) + rm -rf /etc/python3 +esac + +#DEBHELPER# diff --git a/debian/python3.preinst.in b/debian/python3.preinst.in new file mode 100644 index 000000000000000..d385b2ed9e248d8 --- /dev/null +++ b/debian/python3.preinst.in @@ -0,0 +1,30 @@ +#! /bin/sh +set -e + +# remove the python3 alternatives before installing our own python3 link + +update-alternatives --auto /usr/bin/python3 >/dev/null 2>&1 || true + +[ -L /usr/share/doc/python3/html ] || rm -rf /usr/share/doc/python3/html + +case "$1" in + upgrade) + oldv=$(echo $2 | sed 's/^\(...\).*/\1/') + if [ "$DEBIAN_FRONTEND" != noninteractive ]; then + echo "running python pre-rtupdate hooks for @PVER@..." + fi + for hook in /usr/share/python3/runtime.d/*.rtupdate; do + [ -x $hook ] || continue + if ! $hook pre-rtupdate python$oldv @PVER@; then + hb=$(basename $hook .rtupdate) + echo >&2 "error running python pre-rtupdate hook $hb" + echo >&2 "running python failed-pre-rtupdate hook $hb" + $hook failed-pre-rtupdate python$oldv @PVER@ + errors=yes + break + fi + done + [ -z "$errors" ] || exit 3 +esac + +#DEBHELPER# diff --git a/debian/python3.prerm b/debian/python3.prerm new file mode 100644 index 000000000000000..75756aed39767ea --- /dev/null +++ b/debian/python3.prerm @@ -0,0 +1,8 @@ +#! /bin/sh +set -e + +if which py3clean >/dev/null 2>&1; then + py3clean -p python3 +fi + +#DEBHELPER# diff --git a/debian/rules b/debian/rules new file mode 100755 index 000000000000000..6e91a2f7dbebfb7 --- /dev/null +++ b/debian/rules @@ -0,0 +1,424 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. + +export SHELL = /bin/bash + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +include /usr/share/dpkg/architecture.mk + +changelog_values := $(shell dpkg-parsechangelog \ + | awk '/^(Version|Source):/ {print $$2}') +PKGSOURCE := $(word 1, $(changelog_values)) +PKGVERSION := $(word 2, $(changelog_values)) +UPSTRVER := $(shell echo $(PKGVERSION) | sed -rne 's,(.*)-.*,\1,p') +IPKGVER := $(shell echo $(PKGVERSION) | sed -rne 's,(.*)\+.*,\1,p') +VER := $(shell echo $(PKGVERSION) | sed -rne 's,(.{3}).*,\1,p') +NVER := $(shell echo $(VER) | awk 'BEGIN{FS="." }{print $$1 "." $$2 + 1}') + + +distribution := $(shell dpkg-vendor --query Vendor) +distrelease := $(shell lsb_release -cs) + +# requiered python3.x version +UPSTRVER := 3.7.3-1~ + +# required versions of python3-lib2to3 and python3-distutils +STDLIBVER := 3.7.2-1~ + +ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy lucid maverick natty oneiric precise quantal raring saucy trusty)) + bd_i586 = dpkg-dev (>= 1.17.11), python3.7:any (>= 3.7.3-1~), +else + bd_i586 = dpkg-dev (>= 1.16.1~), +endif + +PWD := $(shell pwd) + +d := debian/tmp +scriptdir = usr/share/lib/python$(VER) +scriptdir = usr/share/python$(VER) +scriptdir = usr/lib/python$(VER) + +rst2html = rst2html + +with_doc = yes +ifneq ($(with_doc),yes) + NOPKGS = -Npython-doc +endif + +build-arch: build +build-indep: build + +build: stamp-build +stamp-build: + touch stamp-build + +stamp-doc-policy: + xsltproc --nonet --novalid debian/html.xsl debian/python-policy.dbk \ + | w3m -o display_charset=UTF-8 -cols 70 -dump -no-graph -T text/html > python-policy.txt + mv -f python-policy.txt debian/ + rm -rf debian/python-policy.html + mkdir python-policy.html + ( cd python-policy.html; xsltproc --nonet --novalid ../debian/chunk.xsl ../debian/python-policy.dbk ) + mv -f python-policy.html debian/ + touch stamp-doc-policy + +stamp-doc: stamp-doc-policy + touch stamp-doc + +control-file: + sed -e "s/@UPSTRVER@/$(UPSTRVER)/g" \ + -e "s/@STDLIBVER@/$(STDLIBVER)/g" \ + -e "s/@IPKGVER@/$(IPKGVER)/g" \ + -e "s/@NVER@/$(NVER)/g" \ + -e "s/@VER@/$(VER)/g" \ + -e "s/@bd_i586@/$(bd_i586)/g" \ + debian/control.tmp +ifeq ($(distribution),Ubuntu) + ifneq (,$(findstring ubuntu, $(PKGVERSION))) + m='Ubuntu Developers '; \ + sed -i "/^Maintainer:/s/\(.*\)/Maintainer: $$m\nXSBC-Original-\1/" \ + debian/control.tmp + endif +endif + [ -e debian/control ] \ + && cmp -s debian/control debian/control.tmp \ + && rm -f debian/control.tmp && exit 0; \ + mv debian/control.tmp debian/control + +faqs = index general programming library extending windows gui installed +get-faq: + rm -rf faq + mkdir faq + cd faq && \ + wget -nv $(foreach p,$(faqs),http://python.org/doc/faq/$(p).ht) + sed 's,\<\([a-zA-Z0-9]*\.html\)\>,faq/\1,' faq/index.ht \ + | awk '/^Translations$$/ {exit} {print}' > faq/FAQ.ht + ( \ + echo ''; \ + echo 'This is a local copy of the online FAQ located at'; \ + echo 'http://python.org/doc/faq.'; \ + echo "The copy was fetched and generated in `date '+%B %Y'`."; \ + ) >> faq/FAQ.ht + rm -f faq/index.ht + +clean: control-file + dh_testdir + dh_testroot + rm -f stamp-* + rm -f patch-stamp* + + rm -f debian/python-policy.txt + rm -rf debian/python-policy.html + rm -f faq/*.h2 faq/*.html + + set -e;\ + for f in debian/*.in; do \ + f2=`echo $$f | sed "s,PVER,python$(VER),g;s/VER/$(VER)/g;s,\.in$$,,"`; \ + if [ $$f2 != debian/control ]; then \ + rm -f $$f2; \ + fi; \ + done + rm -f debian/*.py[co] + make clean + dh_clean + +stamp-control: + : # We have to prepare the various control files + + set -e;\ + for f in debian/*.in; do \ + f2=`echo $$f | sed "s,PVER,python$(VER),g;s/VER/$(VER)/g;s,\.in$$,,"`; \ + if [ $$f2 != debian/control ]; then \ + sed -e "s/@PVER@/python$(VER)/g;s/@VER@/$(VER)/g" \ + -e "s/@PRIORITY@/$(PRIORITY)/g" \ + -e "s,@SCRIPTDIR@,/$(scriptdir),g" \ + <$$f >$$f2; \ + fi; \ + done + +install: build stamp-dh_python stamp-install +stamp-install: stamp-build control-file stamp-control + dh_testdir + dh_testroot + dh_installdirs + dh_install +ifeq (0,1) + dh_installdirs usr/share/doc/python/faq + + set -e; \ + cd faq && \ + for p in *.ht; do \ + p=`basename $$p .ht`; \ + echo $(rst2html) $$p.ht $$p.html; \ + awk 'NR > 2' $$p.ht > $$p.ht2; \ + $(rst2html) $$p.ht2 $$p.html; \ + mv $$p.html ../debian/python/usr/share/doc/python/faq/; \ + rm -f $$p.ht2; \ + done + mv debian/python/usr/share/doc/python/faq/FAQ.html \ + debian/python/usr/share/doc/python/ +endif + touch stamp-install + +stamp-dh_python: + dh_testdir + dh_testroot + dh_installdirs + #make check_versions + DESTDIR=debian/python3 PREFIX=/usr make install-dev + DESTDIR=debian/python3-minimal PREFIX=/usr make install-runtime manpages + # disabled by default, run manually if you want to update it + # (requires apt-file and network connection) + #make dist_fallback + touch $@ + +# Build architecture-independent files here. +binary-indep: build install stamp-doc + dh_testdir -i + dh_testroot -i + dh_installman -i + +ifeq ($(with_doc),yes) + mkdir -p debian/python3-doc/usr/share/doc/python3 + ln -sf ../python$(VER)-doc/html \ + debian/python3-doc/usr/share/doc/python3/html + mkdir -p debian/python3-doc/usr/share/doc/python3-doc + ln -sf ../python$(VER)-doc/html \ + debian/python3-doc/usr/share/doc/python3-doc/html +endif + + : # provide the idle and idle.1 defaults + mkdir -p debian/idle/usr/bin + install -m 755 debian/idle.py debian/idle/usr/bin/idle + + mkdir -p debian/idle/usr/share/man/man1 + install -m 644 debian/idle.1 debian/idle/usr/share/man/man1/idle.1 + + mkdir -p debian/idle/usr/share/pixmaps + ln -sf python3.xpm debian/idle/usr/share/pixmaps/idle.xpm + + mkdir -p debian/idle/usr/share/applications + cp -p debian/idle.desktop debian/idle/usr/share/applications/ + + : # provide the 2to3-3 a and 2to3-3.1 defaults + mkdir -p debian/2to3/usr/bin + install -m 755 debian/2to3.py debian/2to3/usr/bin/2to3 + + mkdir -p debian/2to3/usr/share/man/man1 + install -m 644 debian/2to3.1 debian/2to3/usr/share/man/man1/2to3.1 + +# dh_installdebconf -i $(NOPKGS) + dh_lintian -i + dh_installdocs -i $(NOPKGS) --all debian/README.Debian + dh_installchangelogs -i $(NOPKGS) + + for p in examples idle idle3; do \ + case $$p in idle*) : ;; *) p=python3-$$p; esac; \ + rm -rf debian/$$p/usr/share/doc/$$p; \ + ln -sf python3 debian/$$p/usr/share/doc/$$p; \ + done + + dh_compress -i $(NOPKGS) + dh_fixperms -i $(NOPKGS) + dh_installdeb -i $(NOPKGS) + dh_gencontrol -i $(NOPKGS) + dh_md5sums -i $(NOPKGS) + dh_builddeb -i $(NOPKGS) + +# Build architecture-dependent files here. +binary-arch: build install stamp-doc + dh_testdir -a + dh_testroot -a + dh_installman -a + + : # provide the python and python.1 defaults + mkdir -p debian/python3-minimal/usr/bin + ln -sf python$(VER) debian/python3-minimal/usr/bin/python3 + ln -sf python$(VER)m debian/python3-minimal/usr/bin/python3m + mkdir -p debian/python3-minimal/usr/share/man/man1 + ln -sf python$(VER).1.gz \ + debian/python3-minimal/usr/share/man/man1/python3.1.gz + ln -sf python$(VER)m.1.gz \ + debian/python3-minimal/usr/share/man/man1/python3m.1.gz + + : # + mkdir -p debian/python3-minimal/usr/share/python3 + cp -p debian/debian_defaults \ + debian/python3-minimal/usr/share/python3/ + + install -m 755 debian/py3versions.py \ + debian/python3-minimal/usr/share/python3/ + install -m 644 debian/py3versions.1 \ + debian/python3-minimal/usr/share/man/man1/ + dh_link -ppython3-minimal /usr/share/python3/py3versions.py /usr/bin/py3versions + +# mkdir debian/python-minimal/usr/share/python-central +# cp -p debian/python.pycentral debian/python-minimal/usr/share/python-central/ + + mkdir -p debian/python3/usr/bin + ln -sf pydoc$(VER) debian/python3/usr/bin/pydoc3 + ln -sf pygettext$(VER) debian/python3/usr/bin/pygettext3 + ln -sf pdb$(VER) debian/python3/usr/bin/pdb3 + + mkdir -p debian/python3/usr/share/python3 + install -m 644 debian/python.mk \ + debian/python3/usr/share/python3/ + + mkdir -p debian/python3/usr/share/man/man1 + ln -sf pydoc$(VER).1.gz \ + debian/python3/usr/share/man/man1/pydoc3.1.gz + ln -sf pygettext$(VER).1.gz \ + debian/python3/usr/share/man/man1/pygettext3.1.gz + ln -sf pdb$(VER).1.gz \ + debian/python3/usr/share/man/man1/pdb3.1.gz + + mkdir -p debian/python3/usr/share/doc/python3 + cp -a debian/python-policy.{html,dbk,txt} \ + debian/python3/usr/share/doc/python3/ + + mkdir -p debian/python3/usr/share/pixmaps + ln -sf python$(VER).xpm debian/python3/usr/share/pixmaps/python3.xpm + + : # add symlinks to policy files + mkdir -p debian/python3/usr/share/doc/python$(VER) + for ext in html dbk.gz txt.gz; do \ + ln -sf ../python3/python-policy.$$ext \ + debian/python3/usr/share/doc/python$(VER)/python-policy.$$ext; \ + done + +ifeq (0,1) + mkdir -p debian/python3/usr/share/apps/konsole + cp -p debian/python.desktop debian/python3/usr/share/apps/konsole/ +endif + + : # provide the python3-config default + mkdir -p debian/python3-dev/usr/bin + ln -sf python$(VER)m-config debian/python3-dev/usr/bin/python3m-config + mkdir -p debian/python3-dev/usr/share/man/man1 + ln -sf python$(VER)m-config.1.gz \ + debian/python3-dev/usr/share/man/man1/python3m-config.1.gz + ln -sf python$(VER)-config debian/python3-dev/usr/bin/python3-config + ln -sf python$(VER)-config.1.gz \ + debian/python3-dev/usr/share/man/man1/python3-config.1.gz + + : # provide pkgconfig defaults + mkdir -p debian/python3-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig + ln -sf python-$(VER).pc debian/python3-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python3.pc + mkdir -p debian/python3-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig + ln -sf python-$(VER)-dbg.pc debian/python3-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python3-dbg.pc + +ifeq (0,1) + : # provide pyconfig.h in the non-multiarch location. + mkdir -p debian/python3-dev/usr/include/python$(VER)m + ln -sf ../$(DEB_HOST_MULTIARCH)/python$(VER)m/pyconfig.h \ + debian/python3-dev/usr/include/python$(VER)m/pyconfig.h + mkdir -p debian/python3-dbg/usr/include/python$(VER)dm + ln -sf ../$(DEB_HOST_MULTIARCH)/python$(VER)dm/pyconfig.h \ + debian/python3-dbg/usr/include/python$(VER)dm/pyconfig.h +endif + + : # provide the python-dbg and python-dbg.1 defaults + mkdir -p debian/python3-dbg/usr/bin + ln -sf python$(VER)dm debian/python3-dbg/usr/bin/python3dm + ln -sf python$(VER)dm-config debian/python3-dbg/usr/bin/python3dm-config + ln -sf python$(VER)-dbg debian/python3-dbg/usr/bin/python3-dbg + ln -sf python$(VER)-dbg-config debian/python3-dbg/usr/bin/python3-dbg-config + mkdir -p debian/python3-dbg/usr/share/man/man1 + ln -sf python$(VER)dm.1.gz \ + debian/python3-dbg/usr/share/man/man1/python3dm.1.gz + ln -sf python$(VER)dm-config.1.gz \ + debian/python3-dbg/usr/share/man/man1/python3dm-config.1.gz + ln -sf python$(VER)-dbg.1.gz \ + debian/python3-dbg/usr/share/man/man1/python3-dbg.1.gz + ln -sf python$(VER)-dbg-config.1.gz \ + debian/python3-dbg/usr/share/man/man1/python3-dbg-config.1.gz + mkdir -p debian/python3-dbg/usr/share/doc/python3 + ln -sf ../python$(VER)/SpecialBuilds.txt.gz \ + debian/python3-dbg/usr/share/doc/python3/SpecialBuilds.txt.gz + ln -sf ../python$(VER)/README.debug \ + debian/python3-dbg/usr/share/doc/python3/README.debug + + mkdir -p debian/python3/usr/lib/valgrind + cp -p debian/valgrind-python.supp \ + debian/python3/usr/lib/valgrind/python3.supp + + : # provide the DEB_HOST_GNU_TYPE/DEB_HOST_MULTIRACH python-config defaults + mkdir -p debian/libpython3-dev/usr/bin + ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)m-config \ + debian/libpython3-dev/usr/bin/$(DEB_HOST_MULTIARCH)-python3m-config + ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)-config \ + debian/libpython3-dev/usr/bin/$(DEB_HOST_MULTIARCH)-python3-config + mkdir -p debian/libpython3-dev/usr/share/man/man1 + ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)m-config.1.gz \ + debian/libpython3-dev/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-python3m-config.1.gz + ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)-config.1.gz \ + debian/libpython3-dev/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-python3-config.1.gz +ifneq ($(DEB_HOST_MULTIARCH),$(DEB_HOST_GNU_TYPE)) + ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)m-config \ + debian/libpython3-dev/usr/bin/$(DEB_HOST_GNU_TYPE)-python3m-config + ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)-config \ + debian/libpython3-dev/usr/bin/$(DEB_HOST_GNU_TYPE)-python3-config + ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)m-config.1.gz \ + debian/libpython3-dev/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-python3m-config.1.gz + ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)-config.1.gz \ + debian/libpython3-dev/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-python3-config.1.gz +endif + + mkdir -p debian/libpython3-dbg/usr/bin + ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)dm-config \ + debian/libpython3-dbg/usr/bin/$(DEB_HOST_MULTIARCH)-python3dm-config + ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)-dbg-config \ + debian/libpython3-dbg/usr/bin/$(DEB_HOST_MULTIARCH)-python3-dbg-config + mkdir -p debian/libpython3-dbg/usr/share/man/man1 + ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)dm-config.1.gz \ + debian/libpython3-dbg/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-python3dm-config.1.gz + ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)-dbg-config.1.gz \ + debian/libpython3-dbg/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-python3-dbg-config.1.gz +ifneq ($(DEB_HOST_MULTIARCH),$(DEB_HOST_GNU_TYPE)) + ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)dm-config \ + debian/libpython3-dbg/usr/bin/$(DEB_HOST_GNU_TYPE)-python3dm-config + ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)-dbg-config \ + debian/libpython3-dbg/usr/bin/$(DEB_HOST_GNU_TYPE)-python3-dbg-config + ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)dm-config.1.gz \ + debian/libpython3-dbg/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-python3dm-config.1.gz + ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)-dbg-config.1.gz \ + debian/libpython3-dbg/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-python3-dbg-config.1.gz +endif + + : # provide the pyvenv and pyvenv.1 defaults + mkdir -p debian/python3-venv/usr/bin + ln -sf pyvenv-$(VER) debian/python3-venv/usr/bin/pyvenv + mkdir -p debian/python3-venv/usr/share/man/man1 + ln -sf pyvenv-$(VER).1.gz \ + debian/python3-venv/usr/share/man/man1/pyvenv.1.gz + + dh_lintian -a + dh_installdocs -a $(NOPKGS) --all debian/README.Debian + dh_installchangelogs -a $(NOPKGS) + + for p in all all-dev all-dbg dbg dev venv; do \ + case $$p in idle*) : ;; *) p=python3-$$p; esac; \ + rm -rf debian/$$p/usr/share/doc/$$p; \ + ln -sf python3 debian/$$p/usr/share/doc/$$p; \ + done + rm -rf debian/libpython3-all-dev/usr/share/doc/libpython3-all-dev + ln -sf libpython3-dev debian/libpython3-all-dev/usr/share/doc/libpython3-all-dev + rm -rf debian/libpython3-all-dbg/usr/share/doc/libpython3-all-dbg + ln -sf libpython3-dbg debian/libpython3-all-dbg/usr/share/doc/libpython3-all-dbg + + dh_compress -a $(NOPKGS) + dh_fixperms -a $(NOPKGS) + dh_installdeb -a $(NOPKGS) + dh_gencontrol -a $(NOPKGS) + dh_md5sums -a $(NOPKGS) + dh_builddeb -a $(NOPKGS) + +binary: binary-indep binary-arch + +.PHONY: control-file configure build clean binary-indep binary-arch binary install + +# Local Variables: +# mode: makefile +# end: diff --git a/debian/source.lintian-overrides b/debian/source.lintian-overrides new file mode 100644 index 000000000000000..dc83957ef67b888 --- /dev/null +++ b/debian/source.lintian-overrides @@ -0,0 +1,7 @@ +# this source package provides these packages so it cannot depend on them +dbg-package-missing-depends python3-all-dbg +dbg-package-missing-depends python3-dbg +dbg-package-missing-depends libpython3-all-dbg +dbg-package-missing-depends libpython3-dbg + +native-package-with-dash-version diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 000000000000000..d3827e75a5cadb9 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +1.0 diff --git a/debian/valgrind-python.supp b/debian/valgrind-python.supp new file mode 100644 index 000000000000000..259479b53ea809c --- /dev/null +++ b/debian/valgrind-python.supp @@ -0,0 +1,492 @@ +# +# This is a valgrind suppression file that should be used when using valgrind. +# +# --------------------------------------------------------------------------- +# Debian note: +# The file Misc/valgrind-python.supp is placed in an modified form into the +# directory /usr/lib/valgrind as python.supp. There's no need to to add it +# with the --suppressions option. +# The unmodified file is found in /usr/share/doc/python3.6/ +# +# The python3.6-dbg build has been compiled with -DPy_USING_MEMORY_DEBUGGER +# so you can safely comment out the suppressions for PyObject_Free and +# PyObject_Realloc. +# --------------------------------------------------------------------------- + +# Here's an example of running valgrind: +# +# cd python/dist/src +# valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \ +# ./python -E ./Lib/test/regrtest.py -u gui,network +# +# You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER +# to use the preferred suppressions with address_in_range. +# +# If you do not want to recompile Python, you can uncomment +# suppressions for PyObject_Free and PyObject_Realloc. +# +# See Misc/README.valgrind for more information. + +# all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Addr4 + fun:address_in_range +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Value4 + fun:address_in_range +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64) + Memcheck:Value8 + fun:address_in_range +} + +{ + ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value + Memcheck:Cond + fun:address_in_range +} + +# +# Leaks (including possible leaks) +# Hmmm, I wonder if this masks some real leaks. I think it does. +# Will need to fix that. +# + +{ + Suppress leaking the GIL. Happens once per process, see comment in ceval.c. + Memcheck:Leak + fun:malloc + fun:PyThread_allocate_lock + fun:PyEval_InitThreads +} + +{ + Suppress leaking the GIL after a fork. + Memcheck:Leak + fun:malloc + fun:PyThread_allocate_lock + fun:PyEval_ReInitThreads +} + +{ + Suppress leaking the autoTLSkey. This looks like it shouldn't leak though. + Memcheck:Leak + fun:malloc + fun:PyThread_create_key + fun:_PyGILState_Init + fun:Py_InitializeEx + fun:Py_Main +} + +{ + Hmmm, is this a real leak or like the GIL? + Memcheck:Leak + fun:malloc + fun:PyThread_ReInitTLS +} + +{ + Handle PyMalloc confusing valgrind (possibly leaked) + Memcheck:Leak + fun:realloc + fun:_PyObject_GC_Resize + fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING +} + +{ + Handle PyMalloc confusing valgrind (possibly leaked) + Memcheck:Leak + fun:malloc + fun:_PyObject_GC_New + fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING +} + +{ + Handle PyMalloc confusing valgrind (possibly leaked) + Memcheck:Leak + fun:malloc + fun:_PyObject_GC_NewVar + fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING +} + +# +# Non-python specific leaks +# + +{ + Handle pthread issue (possibly leaked) + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls_storage + fun:_dl_allocate_tls +} + +{ + Handle pthread issue (possibly leaked) + Memcheck:Leak + fun:memalign + fun:_dl_allocate_tls_storage + fun:_dl_allocate_tls +} + +###{ +### ADDRESS_IN_RANGE/Invalid read of size 4 +### Memcheck:Addr4 +### fun:PyObject_Free +###} +### +###{ +### ADDRESS_IN_RANGE/Invalid read of size 4 +### Memcheck:Value4 +### fun:PyObject_Free +###} +### +###{ +### ADDRESS_IN_RANGE/Use of uninitialised value of size 8 +### Memcheck:Addr8 +### fun:PyObject_Free +###} +### +###{ +### ADDRESS_IN_RANGE/Use of uninitialised value of size 8 +### Memcheck:Value8 +### fun:PyObject_Free +###} +### +###{ +### ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value +### Memcheck:Cond +### fun:PyObject_Free +###} + +###{ +### ADDRESS_IN_RANGE/Invalid read of size 4 +### Memcheck:Addr4 +### fun:PyObject_Realloc +###} +### +###{ +### ADDRESS_IN_RANGE/Invalid read of size 4 +### Memcheck:Value4 +### fun:PyObject_Realloc +###} +### +###{ +### ADDRESS_IN_RANGE/Use of uninitialised value of size 8 +### Memcheck:Addr8 +### fun:PyObject_Realloc +###} +### +###{ +### ADDRESS_IN_RANGE/Use of uninitialised value of size 8 +### Memcheck:Value8 +### fun:PyObject_Realloc +###} +### +###{ +### ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value +### Memcheck:Cond +### fun:PyObject_Realloc +###} + +### +### All the suppressions below are for errors that occur within libraries +### that Python uses. The problems to not appear to be related to Python's +### use of the libraries. +### + +{ + Generic ubuntu ld problems + Memcheck:Addr8 + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} + +{ + Generic gentoo ld problems + Memcheck:Cond + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so +} + +{ + DBM problems, see test_dbm + Memcheck:Param + write(buf) + fun:write + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_close +} + +{ + DBM problems, see test_dbm + Memcheck:Value8 + fun:memmove + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_store + fun:dbm_ass_sub +} + +{ + DBM problems, see test_dbm + Memcheck:Cond + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_store + fun:dbm_ass_sub +} + +{ + DBM problems, see test_dbm + Memcheck:Cond + fun:memmove + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_store + fun:dbm_ass_sub +} + +{ + GDBM problems, see test_gdbm + Memcheck:Param + write(buf) + fun:write + fun:gdbm_open + +} + +{ + ZLIB problems, see test_gzip + Memcheck:Cond + obj:/lib/libz.so.1.2.3 + obj:/lib/libz.so.1.2.3 + fun:deflate +} + +{ + Avoid problems w/readline doing a putenv and leaking on exit + Memcheck:Leak + fun:malloc + fun:xmalloc + fun:sh_set_lines_and_columns + fun:_rl_get_screen_size + fun:_rl_init_terminal_io + obj:/lib/libreadline.so.4.3 + fun:rl_initialize +} + +### +### These occur from somewhere within the SSL, when running +### test_socket_sll. They are too general to leave on by default. +### +###{ +### somewhere in SSL stuff +### Memcheck:Cond +### fun:memset +###} +###{ +### somewhere in SSL stuff +### Memcheck:Value4 +### fun:memset +###} +### +###{ +### somewhere in SSL stuff +### Memcheck:Cond +### fun:MD5_Update +###} +### +###{ +### somewhere in SSL stuff +### Memcheck:Value4 +### fun:MD5_Update +###} + +# Fedora's package "openssl-1.0.1-0.1.beta2.fc17.x86_64" on x86_64 +# See http://bugs.python.org/issue14171 +{ + openssl 1.0.1 prng 1 + Memcheck:Cond + fun:bcmp + fun:fips_get_entropy + fun:FIPS_drbg_instantiate + fun:RAND_init_fips + fun:OPENSSL_init_library + fun:SSL_library_init + fun:init_hashlib +} + +{ + openssl 1.0.1 prng 2 + Memcheck:Cond + fun:fips_get_entropy + fun:FIPS_drbg_instantiate + fun:RAND_init_fips + fun:OPENSSL_init_library + fun:SSL_library_init + fun:init_hashlib +} + +{ + openssl 1.0.1 prng 3 + Memcheck:Value8 + fun:_x86_64_AES_encrypt_compact + fun:AES_encrypt +} + +# +# All of these problems come from using test_socket_ssl +# +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_bin2bn +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_num_bits_word +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:BN_num_bits_word +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_mod_exp_mont_word +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_mod_exp_mont +} + +{ + from test_socket_ssl + Memcheck:Param + write(buf) + fun:write + obj:/usr/lib/libcrypto.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:RSA_verify +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:RSA_verify +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:DES_set_key_unchecked +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:DES_encrypt2 +} + +{ + from test_socket_ssl + Memcheck:Cond + obj:/usr/lib/libssl.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Value4 + obj:/usr/lib/libssl.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BUF_MEM_grow_clean +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:memcpy + fun:ssl3_read_bytes +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:SHA1_Update +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:SHA1_Update +} + +{ + test_buffer_non_debug + Memcheck:Addr4 + fun:PyUnicodeUCS2_FSConverter +} + +{ + test_buffer_non_debug + Memcheck:Addr4 + fun:PyUnicode_FSConverter +} + +{ + wcscmp_false_positive + Memcheck:Addr8 + fun:wcscmp + fun:_PyOS_GetOpt + fun:Py_Main + fun:main +} + +# Additional suppressions for the unified decimal tests: +{ + test_decimal + Memcheck:Addr4 + fun:PyUnicodeUCS2_FSConverter +} + +{ + test_decimal2 + Memcheck:Addr4 + fun:PyUnicode_FSConverter +} + diff --git a/debian/watch b/debian/watch new file mode 100644 index 000000000000000..21b00a8f22ddcb5 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=4 +https://www.python.org/downloads/ .*/Python@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/pyconfig.h.in b/pyconfig.h.in index 924d86627b0e9ba..b5a1b0beba6f7c7 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -260,6 +260,10 @@ don't. */ #undef HAVE_DECL_RTLD_NOW +/* Define to 1 if you have the declaration of `SSL_ECH_STATUS_GREASE_ECH', and + to 0 if you don't. */ +#undef HAVE_DECL_SSL_ECH_STATUS_GREASE_ECH + /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME @@ -898,6 +902,9 @@ /* Define to 1 if you have the `openpty' function. */ #undef HAVE_OPENPTY +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENSSL_ECH_H + /* Define if you have the 'panel' library */ #undef HAVE_PANEL @@ -1617,6 +1624,12 @@ /* Define if mvwdelch in curses.h is an expression. */ #undef MVWDELCH_IS_EXPRESSION +/* Define if OpenSSL has ECH support */ +#undef OPENSSL_ECH + +/* Define if OpenSSL does not have ECH support */ +#undef OPENSSL_NO_ECH + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT