packages/lang/python
Daniel Golle d99b5473e5 Werkzeug: update to version 2.2.2
Version 2.2.2
Released 2022-08-08

  Fix router to restore the 2.1 strict_slashes == False behaviour
  whereby leaf-requests match branch rules and vice versa.
  pallets/werkzeug#2489

  Fix router to identify invalid rules rather than hang parsing them,
  and to correctly parse / within converter arguments.
  pallets/werkzeug#2489

  Update subpackage imports in werkzeug.routing to use the import as
  syntax for explicitly re-exporting public attributes.
  pallets/werkzeug#2493

  Parsing of some invalid header characters is more robust.
  pallets/werkzeug#2494

  When starting the development server, a warning not to use it in a
  production deployment is always shown. pallets/werkzeug#2480

  LocalProxy.__wrapped__ is always set to the wrapped object when the
  proxy is unbound, fixing an issue in doctest that would cause it to
  fail. pallets/werkzeug#2485

  Address one ResourceWarning related to the socket used by run_simple.
  pallets/werkzeug#2421

Version 2.2.1
Released 2022-07-27

  Fix router so that /path/ will match a rule /path if strict slashes
  mode is disabled for the rule. pallets/werkzeug#2467

  Fix router so that partial part matches are not allowed i.e. /2df
  does not match /<int>. pallets/werkzeug#2470

  Fix router static part weighting, so that simpler routes are matched
  before more complex ones. pallets/werkzeug#2471

  Restore ValidationError to be importable from werkzeug.routing.
  pallets/werkzeug#2465

Version 2.2.0
Released 2022-07-23

  Deprecated get_script_name, get_query_string, peek_path_info,
  pop_path_info, and extract_path_info. pallets/werkzeug#2461

  Remove previously deprecated code. pallets/werkzeug#2461

  Add MarkupSafe as a dependency and use it to escape values when
  rendering HTML. pallets/werkzeug#2419

  Added the werkzeug.debug.preserve_context mechanism for restoring
  context-local data for a request when running code in the debug
  console. pallets/werkzeug#2439

  Fix compatibility with Python 3.11 by ensuring that end_lineno and
  end_col_offset are present on AST nodes. pallets/werkzeug#2425

  Add a new faster matching router based on a state machine.
  pallets/werkzeug#2433

  Fix branch leaf path masking branch paths when strict-slashes is
  disabled. pallets/werkzeug#1074

  Names within options headers are always converted to lowercase. This
  matches RFC 6266 that the case is not relevant. pallets/werkzeug#2442

  AnyConverter validates the value passed for it when building URLs.
  pallets/werkzeug#2388

  The debugger shows enhanced error locations in tracebacks in Python
  3.11. pallets/werkzeug#2407

  Added Sans-IO is_resource_modified and parse_cookie functions based
  on WSGI versions. pallets/werkzeug#2408

  Added Sans-IO get_content_length function. pallets/werkzeug#2415

  Don’t assume a mimetype for test responses. pallets/werkzeug#2450

  Type checking FileStorage accepts os.PathLike. pallets/werkzeug#2418

Version 2.1.2
Released 2022-04-28

  The development server does not set Transfer-Encoding: chunked for
  1xx, 204, 304, and HEAD responses. pallets/werkzeug#2375

  Response HTML for exceptions and redirects starts with <!doctype
  html> and <html lang=en>. pallets/werkzeug#2390

  Fix ability to set some cache_control attributes to False.
  pallets/werkzeug#2379

  Disable keep-alive connections in the development server, which are
  not supported sufficiently by Python’s http.server.
  pallets/werkzeug#2397

Version 2.1.1
Released 2022-04-01

  ResponseCacheControl.s_maxage converts its value to an int, like
  max_age. pallets/werkzeug#2364

Version 2.1.0
Released 2022-03-28

  Drop support for Python 3.6. pallets/werkzeug#2277

  Using gevent or eventlet requires greenlet>=1.0 or PyPy>=7.3.7.
  werkzeug.locals and contextvars will not work correctly with older
  versions. pallets/werkzeug#2278

  Remove previously deprecated code. pallets/werkzeug#2276

    Remove the non-standard shutdown function from the WSGI environ
    when running the development server. See the docs for alternatives.

    Request and response mixins have all been merged into the Request
    and Response classes.

    The user agent parser and the useragents module is removed. The
    user_agent module provides an interface that can be subclassed to
    add a parser, such as ua-parser. By default it only stores the
    whole string.

    The test client returns TestResponse instances and can no longer be
    treated as a tuple. All data is available as properties on the
    response.

    Remove locals.get_ident and related thread-local code from locals,
    it no longer makes sense when moving to a contextvars-based
    implementation.

    Remove the python -m werkzeug.serving CLI.

    The has_key method on some mapping datastructures; use key in data
    instead.

    Request.disable_data_descriptor is removed, pass shallow=True
    instead.

    Remove the no_etag parameter from Response.freeze().

    Remove the HTTPException.wrap class method.

    Remove the cookie_date function. Use http_date instead.

    Remove the pbkdf2_hex, pbkdf2_bin, and safe_str_cmp functions. Use
    equivalents in hashlib and hmac modules instead.

    Remove the Href class.

    Remove the HTMLBuilder class.

    Remove the invalidate_cached_property function. Use del obj.attr
    instead.

    Remove bind_arguments and validate_arguments. Use Signature.bind()
    and inspect.signature() instead.

    Remove detect_utf_encoding, it’s built-in to json.loads.

    Remove format_string, use string.Template instead.

    Remove escape and unescape. Use MarkupSafe instead.

  The multiple parameter of parse_options_header is deprecated.
  pallets/werkzeug#2357

  Rely on PEP 538 and PEP 540 to handle decoding file names with the
  correct filesystem encoding. The filesystem module is removed.
  pallets/werkzeug#1760

  Default values passed to Headers are validated the same way values
  added later are. pallets/werkzeug#1608

  Setting CacheControl int properties, such as max_age, will convert
  the value to an int. pallets/werkzeug#2230

  Always use socket.fromfd when restarting the dev server.
  pallets/werkzeug#2287

  When passing a dict of URL values to Map.build, list values do not
  filter out None or collapse to a single value. Passing a MultiDict
  does collapse single items. This undoes a previous change that made
  it difficult to pass a list, or None values in a list, to custom URL
  converters. pallets/werkzeug#2249

  run_simple shows instructions for dealing with “address already in
  use” errors, including extra instructions for macOS.
  pallets/werkzeug#2321

  Extend list of characters considered always safe in URLs based on RFC
  3986. pallets/werkzeug#2319

  Optimize the stat reloader to avoid watching unnecessary files in
  more cases. The watchdog reloader is still recommended for
  performance and accuracy. pallets/werkzeug#2141

  The development server uses Transfer-Encoding: chunked for streaming
  responses when it is configured for HTTP/1.1. pallets/werkzeug#2090,
  pallets/werkzeug#1327, pallets/werkzeug#2091

  The development server uses HTTP/1.1, which enables keep-alive
  connections and chunked streaming responses, when threaded or
  processes is enabled. pallets/werkzeug#2323

  cached_property works for classes with __slots__ if a corresponding
  _cache_{name} slot is added. pallets/werkzeug#2332

  Refactor the debugger traceback formatter to use Python’s built-in
  traceback module as much as possible. pallets/werkzeug#1753

  The TestResponse.text property is a shortcut for
  r.get_data(as_text=True), for convenient testing against text instead
  of bytes. pallets/werkzeug#2337

  safe_join ensures that the path remains relative if the trusted
  directory is the empty string. pallets/werkzeug#2349

  Percent-encoded newlines (%0a), which are decoded by WSGI servers,
  are considered when routing instead of terminating the match early.
  pallets/werkzeug#2350

  The test client doesn’t set duplicate headers for CONTENT_LENGTH and
  CONTENT_TYPE. pallets/werkzeug#2348

  append_slash_redirect handles PATH_INFO with internal slashes.
  pallets/werkzeug#1972, pallets/werkzeug#2338

  The default status code for append_slash_redirect is 308 instead of
  301. This preserves the request body, and matches a previous change
  to strict_slashes in routing. pallets/werkzeug#2351

  Fix ValueError: I/O operation on closed file. with the test client
  when following more than one redirect. pallets/werkzeug#2353

  Response.autocorrect_location_header is disabled by default. The
  Location header URL will remain relative, and exclude the scheme and
  domain, by default. pallets/werkzeug#2352

  Request.get_json() will raise a 400 BadRequest error if the
  Content-Type header is not application/json. This makes a very common
  source of confusion more visible. pallets/werkzeug#2339

Version 2.0.3
Released 2022-02-07

  ProxyFix supports IPv6 addresses. pallets/werkzeug#2262

  Type annotation for Response.make_conditional,
  HTTPException.get_response, and Map.bind_to_environ accepts Request
  in addition to WSGIEnvironment for the first parameter.
  pallets/werkzeug#2290

  Fix type annotation for Request.user_agent_class.
  pallets/werkzeug#2273

  Accessing LocalProxy.__class__ and __doc__ on an unbound proxy
  returns the fallback value instead of a method object.
  pallets/werkzeug#2188

  Redirects with the test client set RAW_URI and REQUEST_URI correctly.
  pallets/werkzeug#2151

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-12-22 16:30:59 -08:00
..
2to3 2to3: add package host tool 2022-01-05 15:20:13 +01:00
bcrypt python: Use locked for host pip 2020-08-31 03:48:47 -07:00
borgbackup borgbackup: add package for 1.2.2 2022-11-26 15:24:05 +01:00
click click: update to version 8.0.3 2021-11-15 02:16:00 +00:00
click-log python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
django django: bump version 4.1.3 2022-12-08 08:35:31 +01:00
django-restframework django-restframework: bump to version 3.14.0 2022-10-11 19:16:18 +03:00
Flask Flask: change maintainer to Šimon Bořek 2022-04-27 18:42:21 +02:00
flup Revert "lang: python: flup: drop package" 2020-07-15 15:41:37 +02:00
host-pip-requirements numpy: bump to version 1.23.3 2022-10-07 21:19:36 +03:00
itsdangerous itsdangerous: update to version 2.0.1 2021-08-01 04:15:22 +01:00
Jinja2 Jinja2: change maintainer to Šimon Bořek 2022-04-27 18:56:48 +02:00
MarkupSafe MarkupSafe: update to version 2.1.1 2022-12-22 16:30:48 -08:00
micropython micropython: Update to 1.18, refresh patches 2022-01-24 15:43:39 -08:00
micropython-lib micropython-lib: Update to latest master 2022-06-06 15:09:51 -07:00
numpy numpy: bump to version 1.23.3 2022-10-07 21:19:36 +03:00
openpyxl openpyxl: bump to version 3.0.10 2022-06-03 21:30:45 -07:00
passlib python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
pillow pillow: bump to version 9.3.0 2022-10-30 21:32:06 +01:00
pymysql pymysql: bump to version 1.0.2 2021-01-11 22:56:45 +02:00
pyodbc pyodbc: update to version 4.0.32 2021-10-09 17:02:43 +01:00
python-aiohttp python-aiohttp: update to version 3.7.4post0 2021-09-06 16:00:52 +02:00
python-aiohttp-cors python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-apipkg treewide: change email 2021-07-29 13:21:02 +02:00
python-appdirs python-appdirs: update to version 1.4.4 2020-10-20 13:39:52 +02:00
python-astral python-astral: update to version 2.2 2021-09-17 16:03:47 +02:00
python-async-generator python-async-generator: add package for 1.10 2022-11-26 15:24:04 +01:00
python-async-timeout python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-atomicwrites treewide: change email 2021-07-29 13:21:02 +02:00
python-attrs python-attrs: Update to 21.4.0 2022-01-04 14:48:29 +08:00
python-augeas treewide: change email 2021-07-29 13:21:02 +02:00
python-automat python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-awesomeversion python-awesomeversion: add it to the repository 2021-09-15 12:15:52 +02:00
python-awscli python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-babel python-babel: update to version 2.9.1 2021-08-11 10:11:37 +02:00
python-bidict treewide: change email 2021-07-29 13:21:02 +02:00
python-boto3 python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-botocore python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-cached-property python-cached-property: update to v1.5.2 2020-11-01 15:45:43 +01:00
python-cachelib python-cachelib: update to version 0.3.0 2021-08-17 09:59:42 +02:00
python-cachetools python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-certifi python-certifi: bump to 2022.9.24 2022-10-21 15:10:00 -07:00
python-cffi python-packages: remove myself as maintainer 2021-11-23 13:14:43 +02:00
python-chardet python-chardet: bump to version 5.0.0 2022-07-07 10:35:14 -07:00
python-ciso8601 python-ciso8601: fix missing src package 2020-10-22 15:43:56 +02:00
python-colorama python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-constantly python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-contextlib2 python-contextlib2: bump to version 0.6.0.post1 2020-10-20 13:56:13 +02:00
python-crcmod python-crcmod: add package 2022-10-06 12:16:14 +02:00
python-cryptodome treewide: Run refresh on all packages 2021-02-20 16:02:15 -08:00
python-cryptodomex python-cryptodomex: update to version 3.10.1 2021-05-14 13:08:13 +02:00
python-cryptography python-cryptography: Fix failing build 2022-07-07 17:35:41 +08:00
python-curl python-curl: fix build on macos 2022-01-18 18:09:35 -08:00
python-dateutil python-dateutil: bump to version 2.8.2 2021-07-23 22:59:57 +02:00
python-decorator python-decorator: Update to 4.4.2, change download source to PyPI 2020-05-01 05:02:50 +08:00
python-defusedxml defusedxml: bump to v. 0.7.0 2021-10-13 22:21:06 -07:00
python-distro python3-distro: update to version 1.7.0 2022-03-08 21:54:05 -08:00
python-dns python-dns: update to version 2.2.0 2022-01-31 06:37:23 +01:00
python-docker python-docker: Update to 6.0.0 2022-09-09 15:17:54 -07:00
python-dockerpty python-packages: Remove variants 2020-06-14 03:29:59 +08:00
python-docopt python-packages: Remove variants 2020-06-14 03:29:59 +08:00
python-docutils python-docutils: bump to version 0.19 2022-10-21 15:03:31 -07:00
python-dotenv python-dotenv: update to v0.21.0 2022-09-09 15:18:01 -07:00
python-engineio treewide: change email 2021-07-29 13:21:02 +02:00
python-et_xmlfile et_xmlfile: bump to version 1.1.0 2021-05-18 12:29:01 +03:00
python-evdev python-evdev: bump to 1.6.0 2022-08-22 09:12:13 +03:00
python-eventlet treewide: change email 2021-07-29 13:21:02 +02:00
python-exceptiongroup python-exceptiongroup: add package for 1.0.4 2022-11-26 15:24:04 +01:00
python-execnet treewide: change email 2021-07-29 13:21:02 +02:00
python-flask-babel python-flask-babel: add new package 2020-10-29 15:20:04 +01:00
python-flask-httpauth treewide: change email 2021-07-29 13:21:02 +02:00
python-flask-login treewide: change email 2021-07-29 13:21:02 +02:00
python-flask-seasurf python-flask-seasurf: update to version 0.3.0 2021-01-24 10:08:04 +01:00
python-flask-session python-flask-session: add package 2020-10-29 15:20:04 +01:00
python-flask-socketio python-flask-socketio: update to 5.3.1 2022-09-16 12:51:06 +02:00
python-gmpy2 python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-gnupg python-gnupg: update to version 0.4.7 2021-04-29 00:59:15 +01:00
python-greenlet python-greenlet: bump to version 1.1.2 2021-11-17 10:55:17 +02:00
python-hyperlink python-hyperlink: Update to 21.0.0, refresh patch 2021-02-08 04:49:55 +08:00
python-idna python-packages: remove myself as maintainer 2021-11-23 13:14:43 +02:00
python-ifaddr python-ifaddr: update to version 0.1.7 2020-07-08 15:41:14 +02:00
python-incremental python-incremental: Update to 21.3.0, refresh patch 2021-06-12 02:15:58 +08:00
python-influxdb python-influxdb: bump to version 5.3.0 2020-11-01 08:48:54 +01:00
python-iniconfig treewide: change email 2021-07-29 13:21:02 +02:00
python-intelhex treewide: Run refresh on all packages 2021-02-20 16:02:15 -08:00
python-jdcal python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-jmespath python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-jsonpath-ng python-jsonpath-ng: bump to version 1.5.2 2020-10-20 13:50:26 +02:00
python-jsonschema python-jsonschema: Update to 4.16.0 2022-09-17 12:58:04 -07:00
python-libmodbus python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-lxml python-lxml: bump to version 4.9.1 2022-07-07 10:35:14 -07:00
python-markdown python-markdown: update to version 3.3.6 2021-12-31 12:38:05 +01:00
python-more-itertools treewide: change email 2021-07-29 13:21:02 +02:00
python-msgpack treewide: change email 2021-07-29 13:21:02 +02:00
python-multidict python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-netdisco python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-outcome python-outcome: add package for 1.2.0 2022-11-26 15:24:04 +01:00
python-packaging treewide: change email 2021-07-29 13:21:02 +02:00
python-paho-mqtt python-paho-mqtt: add missing dependency 2022-08-03 17:04:42 +02:00
python-paramiko python3-paramiko: update to version 2.11.0 2022-05-25 17:03:28 -07:00
python-parsley python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-pip-conf python-pip-conf: split package away from python package 2017-12-10 19:49:23 +02:00
python-pluggy treewide: change email 2021-07-29 13:21:02 +02:00
python-ply python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-psutil python-psutil: update to version 5.9.0, fix build on macos 2022-02-24 14:33:56 -08:00
python-psycopg2 python-psycopg2: Add new package 2021-02-23 16:03:51 +01:00
python-py treewide: change email 2021-07-29 13:21:02 +02:00
python-pyasn1 python-packages: remove myself as maintainer 2021-11-23 13:14:43 +02:00
python-pyasn1-modules python-packages: remove myself as maintainer 2021-11-23 13:14:43 +02:00
python-pycares python-pycares: PKG_RELEASE:=1 2022-12-13 11:08:12 +01:00
python-pycparser python-pycparser: Update to 2.21, update patch 2021-11-19 21:47:38 +08:00
python-pycrate python-pycrate: add package 2022-10-06 12:16:14 +02:00
python-pyfuse3 python-pyfuse3: add package for 3.2.2 2022-11-26 15:24:05 +01:00
python-pynacl python-pynacl: update to v1.5.0 2022-01-09 13:47:30 -08:00
python-pyopenssl python-packages: remove myself as maintainer 2021-11-23 13:14:43 +02:00
python-pyotp python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-pyparsing treewide: change email 2021-07-29 13:21:02 +02:00
python-pyrsistent python-pyrsistent: Update to 0.16.0 2020-07-02 04:30:09 +02:00
python-pyserial python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-pysocks treewide: change email 2021-07-29 13:21:02 +02:00
python-pytest treewide: change email 2021-07-29 13:21:02 +02:00
python-pytest-forked treewide: change email 2021-07-29 13:21:02 +02:00
python-pytest-xdist treewide: change email 2021-07-29 13:21:02 +02:00
python-pytz python3-pytz: bump to version 2022.6 2022-12-16 07:34:22 +01:00
python-requests python-requests: bump to version 2.28.1 2022-07-07 10:35:14 -07:00
python-rsa python-rsa: update to version 4.6 (security fix) 2020-09-03 12:06:37 +02:00
python-s3transfer python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-schedule python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-schema python-schema: Update to 0.7.2, change download source to PyPI 2020-05-01 05:11:08 +08:00
python-sentry-sdk python-sentry-sdk: update to 1.5.4 2022-02-04 18:45:12 +01:00
python-service-identity python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-six python-packages: remove myself as maintainer 2021-11-23 13:14:43 +02:00
python-slugify python-slugify: update to version 4.0.1 2021-01-09 18:49:29 +01:00
python-sniffio python-sniffio: add package for 1.3.0 2022-11-26 15:24:04 +01:00
python-socketio treewide: change email 2021-07-29 13:21:02 +02:00
python-sortedcontainers python-sortedcontainers: add package for 2.4.0 2022-11-26 15:24:03 +01:00
python-sqlalchemy python-sqlalchemy: update to version 1.4.22 2021-08-13 03:08:38 +02:00
python-stem python-stem: update to v1.8.1 2022-10-03 15:04:06 -07:00
python-texttable python3-texttable: update to version 1.6.4 2021-09-20 21:12:10 -07:00
python-toml treewide: change email 2021-07-29 13:21:02 +02:00
python-tornado python-tornado: update to version 6.1 2020-11-03 01:50:18 +01:00
python-trio python-trio: add package for 0.22.0 2022-11-26 15:24:05 +01:00
python-twisted python-twisted: Update to 22.4.0, refresh patches 2022-04-18 19:12:27 +08:00
python-typing-extensions treewide: change email 2021-07-29 13:21:02 +02:00
python-ubus python-ubus: add package 2021-02-09 03:20:17 +01:00
python-uci python-uci: update to version 0.9.0 2022-08-25 16:46:29 +02:00
python-urllib3 python-urllib3: update to version 1.25.11 2020-11-03 01:55:24 +01:00
python-voluptuous python-voluptuous: update to version 0.12.1 2021-01-09 18:32:08 +01:00
python-voluptuous-serialize python-voluptuous-serialize: update to version 2.5.0 2021-12-31 00:10:40 +01:00
python-wcwidth treewide: change email 2021-07-29 13:21:02 +02:00
python-websocket-client python-websocket-client: update to 1.4.1 2022-09-09 15:18:12 -07:00
python-websockets python-websockets: update to version 10.3 2022-08-12 21:35:39 +02:00
python-yaml python-yaml: bump to version 6.0 2021-11-21 10:00:28 +02:00
python-yarl python-yarl: update to version 1.6.3 2021-09-07 13:41:44 +02:00
python-zeroconf python-zeroconf: update to version 0.38.1 2021-12-31 00:06:28 +01:00
python-zipp treewide: change email 2021-07-29 13:21:02 +02:00
python-zope-interface python-zope-interface: Update to 5.4.0 2021-06-11 23:44:51 +08:00
python3 python3: fix ssl support by removing libressl patches 2022-12-21 14:27:06 +01:00
python3-asgiref nginx, python3-{asgiref,django-cors-headers,drf-nested-routers,sqlparse}: bump versions 2021-10-30 01:12:02 -07:00
python3-bottle python3-bottle: update to version 0.12.19 2021-04-12 00:47:57 +02:00
python3-django-cors-headers nginx, python3-{asgiref,django-cors-headers,drf-nested-routers,sqlparse}: bump versions 2021-10-30 01:12:02 -07:00
python3-django-etesync-journal django-etesync-journal: update to version 1.2.2 2020-10-17 21:05:50 +02:00
python3-drf-nested-routers nginx, python3-{asgiref,django-cors-headers,drf-nested-routers,sqlparse}: bump versions 2021-10-30 01:12:02 -07:00
python3-iperf3 python3-iperf3: add iperf3 python wrapper 2022-09-14 02:37:44 -07:00
python3-libselinux python3-libselinux: update to 3.3 2021-12-14 08:55:27 -06:00
python3-libsemanage python3-libsemanage: update to 3.2 2021-03-09 16:39:56 -08:00
python3-maxminddb treewide: change email 2021-07-29 13:21:02 +02:00
python3-netifaces python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python3-networkx python3-networkx: update to 2.8 2022-05-11 17:50:42 -04:00
python3-packages python3: Rename canned recipes in python3-package.mk 2020-04-19 01:56:23 +08:00
python3-pyinotify fail2ban: initial package of fail2ban version 0.11.2 2021-09-01 14:08:17 -07:00
python3-pyroute2 python3-pyroute2: update to version 0.5.16 2021-03-30 20:00:53 +02:00
python3-speedtest-cli python3-speedtest-cli: update to 2.1.3 2021-09-18 20:40:54 -04:00
python3-sqlparse nginx, python3-{asgiref,django-cors-headers,drf-nested-routers,sqlparse}: bump versions 2021-10-30 01:12:02 -07:00
python3-unidecode python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
ruamel-yaml ruamel-yaml: bump to version 0.17.17 2021-11-17 14:15:10 +02:00
text-unidecode python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
vobject vobject: Remove maintainer 2020-04-23 03:47:12 +08:00
Werkzeug Werkzeug: update to version 2.2.2 2022-12-22 16:30:59 -08:00
xmltodict python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
pypi.mk python,python3: Add PYPI_SOURCE_NAME to pypi.mk 2019-10-21 15:27:04 +02:00
python-package-install.sh python3: Move functionality into python3-package.mk 2020-04-19 01:56:23 +08:00
python3-find-stdlib-depends.sh python3: Add readline to dependency finder script 2021-06-15 08:56:35 +03:00
python3-host.mk python: Use locked for host pip 2020-08-31 03:48:47 -07:00
python3-package.mk python3: Add Py3Build/InstallBuildDepends recipe 2022-03-17 11:38:19 -07:00
python3-version.mk python3: update to 3.10.7 2022-10-10 16:59:12 +02:00
README.md python3: Add Py3Build/InstallBuildDepends recipe 2022-03-17 11:38:19 -07:00

Python packages folder

Table of contents

  1. Description
  2. Introduction
  3. Python 2 end-of-life
  4. Using Python in external/other package feeds
  5. Build considerations
  6. General folder structure
  7. Building a Python package
    1. Include python3-package.mk
    2. Add Package/<PKG_NAME> OpenWrt definitions
    3. Python package dependencies
    4. Wrapping things up so that they build
    5. Customizing things
    6. Host-side Python packages for build

Description

This section describes specifics for the Python packages that are present in this repo, and how things are structured.

In terms of license, contributing guide, etc, all of that information is described in the top README.md file, and it applies here as well. This document attempts to cover only technical aspects of Python packages, and maybe some explanations about how things are (and why they are as they are).

Introduction

This sub-tree came to exist after a number of contributions (Python packages) were made to this repo, and the lang subtree grew to a point where a decision was made to move all Python packages under lang/python.

It contains the Python 3 interpreter and Python packages. Most of the Python packages are downloaded from pypi.org. Python packages from pypi.org are typically preferred when adding new packages.

If more packages (than the ones packaged here) are needed, they can be downloaded via pip. Note that the versions of pip & setuptools [available in this repo] are the ones that are packaged inside the Python package (yes, Python comes packaged with pip & setuptools).

Python 2 end-of-life

Python 2 will not be maintained past 2020. All Python 2 packages have been removed from the packages feed (this repo) and archived in the abandoned packages feed.

Using Python in external/other package feeds

In the feeds.conf (or feeds.conf.default file, whatever is preferred), the packages repo should be present.

Example

src-git packages https://git.openwrt.org/feed/packages.git
src-git luci https://git.openwrt.org/project/luci.git
src-git routing https://git.openwrt.org/feed/routing.git
src-git telephony https://git.openwrt.org/feed/telephony.git
#
#
src-git someotherfeed https://github.com/<github-user>/<some-other-package>

Assuming that there are Python packages in the <some-other-package>, they should include python3-package.mk like this:

include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk

Same rules apply for python3-package.mk as the Python packages in this repo.

One important consideration:: if the local name is not packages, it's something else, like openwrt-packages. And in feeds.conf[.default] it's:

src-git openwrt-packages https://git.openwrt.org/feed/packages.git

Then, the inclusions also change:

include $(TOPDIR)/feeds/openwrt-packages/lang/python/python3-package.mk

Each maintainer[s] of external packages feeds is responsible for the local name, and relative inclusion path back to this feed (which is named packages by default).

In case there is a need/requirement such that the local package feed is named something else than packages, one approach to make the package flexible to change is:

PYTHON3_PACKAGE_MK:=$(wildcard $(TOPDIR)/feeds/*/lang/python/python3-package.mk)

# verify that there is only one single file returned
ifneq (1,$(words $(PYTHON3_PACKAGE_MK)))
ifeq (0,$(words $(PYTHON3_PACKAGE_MK)))
$(error did not find python3-package.mk in any feed)
else
$(error found multiple python3-package.mk files in the feeds)
endif
else
$(info found python3-package.mk at $(PYTHON3_PACKAGE_MK))
endif

include $(PYTHON3_PACKAGE_MK)

This should solve the corner-case where the python3-package.mk can be in some other feed, or if the packages feed will be named something else locally.

Build considerations

In order to build the Python interpreter, a host Python interpreter needs to be built, in order to process some of the build for the target Python build. The host Python interpreter is also needed so that Python bytecodes are generated, so the host interpreter needs to be the exact version as on the target. And finally, the host Python interpreter also provides pip, so that it may be used to install some Python packages that are required to build other Python packages. That's why you'll also see a Python build & staging directories.

As you're probably thinking, this sounds [and is] somewhat too much complication [just for packaging], but the status of things is-as-it-is, and it's probably much worse than what's currently visible on the surface [with respect to packaging Python & packages].

As mentioned earlier, Python packages are shipped with bytecodes, and the reason for this is simply performance & size. The thought/discussion matrix derives a bit like this:

  • shipping both Python source-code & bytecodes takes too much space on some devices ; Python source code & byte-code take about similar disk-size
  • shipping only Python source code has a big performance penalty [on some lower end systems] ; something like 500 msecs (Python source-only) -> 70 msecs (Python byte-codes) time reduction for a simple "Hello World" script
  • shipping only Python byte-codes seems like a good trade-off, and this means that python3-src can be provided for people that want the source code

By default, automatic Python byte-code generation is disabled when running a Python script, in order to prevent a disk from accidentally filling up. Since some disks reside in RAM, this also means not filling up the RAM. If someone wants to convert Python source to byte-code then he/she is free to compile it [directly on the device] manually via the Python interpreter & library.

General folder structure

The basis of all these packages is:

This is a normal OpenWrt package, which will build the Python interpreter. This also provides python3-pip & python3-setuptools. Each Python package is actually split into multiple sub-packages [e.g. python3-email, python3-sqlite3, etc]. This can be viewed inside lang/python/python3/files.

The reason for this splitting, is purely to offer a way for some people to package Python in as-minimal-as-possible-and-still-runable way, and also to be somewhat maintainable when packaging. A standard Python installation can take ~20-30 MBs of disk, which can be somewhat big for some people, so there is the python3-base package which brings that down to ~5 MBs. This seems to be good enough (and interesting) for a number of people.

The Python interpreter is structured like this:

  • python3-base, which is just the minimal package to startup Python and run basic commands
  • python3 is a meta-package, which installs almost everything (python3-base [plus] Python library [minus] some unit-tests & some windows-y things)
  • python3-light is python3 [minus] packages that are in lang/python/python3/files ; the size of this package may be sensible (and interesting) to another group of people

All other Python packages (aside from the intepreter) typically use these files:

  • python3-host.mk - this file contains paths and build rules for running the Python interpreter on the host-side; they also provide paths to host interprete, host Python lib-dir & so on
  • python3-package.mk
    • includes python3-host.mk
    • contains all the default build rules for Python packages; these will be detailed below in the Building a Python package section

Note that Python packages don't need to use these files (i.e. python3-package.mk & python3-host.mk), but they do provide some ease-of-use & reduction of duplicate code. And they do contain some learned-lessons about packaging Python packages, so it's a good idea to use them.

Building a Python package

Include python3-package.mk

Add this after include $(INCLUDE_DIR)/package.mk

include ../python3-package.mk

This will make sure that build rules for Python can be specified and picked up for build.

Include pypi.mk (optional)

pypi.mk is an include file that makes downloading package source code from pypi.org simpler.

To use pypi.mk, add this before include $(INCLUDE_DIR)/package.mk:

include ../pypi.mk

pypi.mk has several PYPI_* variables that can/must be set (see below); these should be set before pypi.mk is included, i.e. before the include ../pypi.mk line.

pypi.mk also provides default values for PKG_SOURCE and PKG_SOURCE_URL, so these variables may be omitted.

Required variables:

  • PYPI_NAME: Package name on pypi.org. This should match the PyPI name exactly.

    For example (from the python-yaml package):

    PYPI_NAME:=PyYAML
    

Optional variables:

  • PYPI_SOURCE_NAME: Package name component of the source tarball filename
    Default: Same value as PYPI_NAME

  • PYPI_SOURCE_EXT: File extension of the source tarball filename
    Default: tar.gz

pypi.mk constructs the default PKG_SOURCE value from these variables (and PKG_VERSION):

PKG_SOURCE?=$(PYPI_SOURCE_NAME)-$(PKG_VERSION).$(PYPI_SOURCE_EXT)

Add Package/<PKG_NAME> OpenWrt definitions

This part is similar to default OpenWrt packages.

Example:

define Package/python3-lxml
  SECTION:=lang
  CATEGORY:=Languages
  SUBMENU:=Python
  TITLE:=Pythonic XML processing library
  URL:=https://lxml.de
  DEPENDS:=+python3-light +libxml2 +libxslt +libexslt
endef

define Package/python3-lxml/description
  The lxml XML toolkit is a Pythonic binding
  for the C libraries libxml2 and libxslt.
endef

Some considerations here (based on the example above):

  • typically the package is named Package/python3-<something> ; this convention makes things easier to follow, though it could work without naming things this way
  • TITLE can be something a bit more verbose/neat ; typically the name is short as seen above

Python package dependencies

Aside from other libraries and programs, every Python package will depend on at least one of these three types of packages:

  • The Python interpreter: All Python packages should depend on one of these three interpreter packages:

    • python3-light is the best default for most Python packages.

    • python3-base should only be used as a dependency if you are certain the bare interpreter is sufficient.

    • python3 is useful if many (more than three) Python standard library packages are needed.

  • Python standard library packages: As noted above, many parts of the Python standard library are packaged separate from the Python interpreter. These packages are defined by the files in lang/python/python3/files.

    To find out which of these separate standard library packages are necessary, after completing a draft Makefile (including the $(eval ...) lines described in the next section), run make with the configure target and PY3=stdlib V=s in the command line. For example:

    make package/python-lxml/configure PY3=stdlib V=s
    

    If the package has been built previously, include the clean target to trigger configure again:

    make package/python-lxml/{clean,configure} PY3=stdlib V=s
    

    This will search the package for module imports and generate a list of suggested dependencies. Some of the found imports may be false positives, e.g. in example or test files, so examine the matches for more information.

  • Other Python packages: The easiest way to find these dependencies is to look for the install_requires keyword inside the package's setup.py file (it will be a keyword argument to the setup() function). This will be a list of run-time dependencies for the package.

    There may already be packages in the packages feed that provide these dependencies. If not, they will need to be packaged for your Python package to function correctly.

    Any packages in a setup_requires keyword argument are build-time dependencies that may need to be installed on the host (host Python inside of OpenWrt buildroot, not system Python that is part of the outer computer system). To ensure these build-time dependencies are present, see Host-side Python packages for build. (Note that Setuptools is already installed as part of host Python.)

Wrapping things up so that they build

If all the above prerequisites have been met, all that's left is:

$(eval $(call Py3Package,python3-lxml))
$(eval $(call BuildPackage,python3-lxml))

The $(eval $(call Py3Package,python3-lxml)) part will instantiate all the default Python build rules so that the final Python package is packaged into an OpenWrt. And $(eval $(call BuildPackage,python3-lxml)) will bind all the rules generated with $(eval $(call Py3Package,python3-lxml)) into the OpenWrt build system.

These packages will contain byte-codes and binaries (shared libs & other stuff).

If a user wishes to ship source code, adding one more line creates one more package that ship Python source code:

$(eval $(call Py3Package,python3-lxml))
$(eval $(call BuildPackage,python3-lxml))
$(eval $(call BuildPackage,python3-lxml-src))

The name *-src must be the Python package name; so for python3-lxml-src a equivalent python3-lxml name must exist.

Customizing things

Some packages need custom build rules (because they do).

The default package build and install processes are defined in python3-package.mk.

Building

The default build process calls setup.py install inside the directory where the Python source package is extracted (PKG_BUILD_DIR). This "installs" the Python package to an intermediate location (PKG_INSTALL_DIR) where it is used by the default install process.

There are several Makefile variables that can be used to customize this process (all optional):

  • PYTHON3_PKG_SETUP_DIR: Path where setup.py can be found, relative to the package directory (PKG_BUILD_DIR).
    Default: empty value (setup.py is in the package directory)
  • PYTHON3_PKG_SETUP_VARS: Additional environment variables to set for the call to setup.py. Should be in the form of VARIABLE1=value VARIABLE2=value ....
    Default: empty value
  • PYTHON3_PKG_SETUP_GLOBAL_ARGS: Additional command line arguments to pass to setup.py, before / in front of the install command.
    Default: empty value
  • PYTHON3_PKG_SETUP_ARGS: Additional command line arguments to pass to setup.py, after the install command.
    Default: --single-version-externally-managed

Conceptually, these variables are used in this way:

cd $(PKG_BUILD_DIR)/$(PYTHON3_PKG_SETUP_DIR)
$(PYTHON3_PKG_SETUP_VARS) python3 setup.py $(PYTHON3_PKG_SETUP_GLOBAL_ARGS) install $(PYTHON3_PKG_SETUP_ARGS)

The default build process can be completely overridden by defining a custom Py3Build/Compile rule in the package Makefile.

Installing

The default install process copies some/all of the files from PKG_INSTALL_DIR, placed there by the build process, to a location passed to the install rule as the first argument ($(1)). The OpenWrt build system will then take those files and create the actual .ipk package archives.

This default process uses 2 build rules:

  • Py3Package/<package>/filespec which are Python library files relative to /usr/lib/pythonX.Y ; by default this is /usr/lib/python$(PYTHON3_VERSION)/site-packages (PYTHON3_PKG_DIR) ; most Python packages generate files that get installed in this sub-folder
  • Py3Package/<package>/install is similar to Package/<package>/install ; this allows binary (or other files) to be installed on the target

Both the 2 above rules generate a Package/<package>/install build rule, which gets picked up by the build system. Both can be used together (they are not mutually exclusive), and provide a good enough flexibility for specifying Python packages.

The Py3Package/<package>/filespec rule contains one or more lines of the following format (whitespace added for clarity):

<one of: +-=> | <file/directory path> | <file permissions>

The initial character controls the action that will be taken:

  • +: Install the given path. If the path is a directory, all files and subdirectories inside are installed.
    • If file permissions is specified (optional), then the file or directory (and all files and subdirectories) are assigned the given permissions; if omitted, then the file or directory retains its original permissions.
  • -: Remove the given path. Useful when most of a directory should be installed except for a few files or subdirectories.
    • File permissions is not used / ignored in this case.
  • =: Assign the given file permissions to the given path. File permissions is required in this case.

As mentioned, the default Py3Package/<package>/filespec installs PYTHON3_PKG_DIR:

define Py3Package/python3-example/filespec
+|$(PYTHON3_PKG_DIR)
endef

If the package installs a example_package directory inside PYTHON3_PKG_DIR, and there is an examples directory and test_*.py files that can be omitted to save space, this can be specified as:

define Py3Package/python3-example/filespec
+|$(PYTHON3_PKG_DIR)
-|$(PYTHON3_PKG_DIR)/example_package/examples
-|$(PYTHON3_PKG_DIR)/example_package/test_*.py
endef

Host-side Python packages for build

These can be installed via pip and ideally they should only be installed like this, because it's a bit simpler than running them through the OpenWrt build system.

Requirements files

All host-side Python packages are installed with pip using requirements files, with hash-checking mode enabled. These requirements files are stored in the host-pip-requirements directory.

Each requirements file is named after the Python package it installs and contains the package's pinned version and --hash option. The --hash option value is the SHA256 hash of the package's source tarball; this value can be found on pypi.org.

For example, the requirements file for setuptools-scm (setuptools-scm.txt) contains:

setuptools-scm==4.1.2 --hash=sha256:a8994582e716ec690f33fec70cca0f85bd23ec974e3f783233e4879090a7faa8

If the Python package to be installed depends on other Python packages, those dependencies, with their pinned versions and --hash options, also need to be specified in the requirements file. For instance, cffi.txt includes information for pycparser because pycparser is a dependency of cffi and will be installed with cffi.

There are two types of requirements files in host-pip-requirements:

  • Installs the latest version of a Python package.

    A requirements file of this type is named with the package name only (for example, setuptools-scm.txt) and is used when there is no strict version requirement.

    These files will be updated as newer versions of the Python packages are available.

  • Installs a specific version of a Python package.

    A requirements file of this type is named with the package name and version number (for example, Django-1.11.txt) and is used when a specific (usually older) version is required.

    Installing the latest versions of packages is preferred over specific versions whenever possible.

Installing host-side Python packages

Set HOST_PYTHON3_PACKAGE_BUILD_DEPENDS to the names of one or more requirements files in host-pip-requirements, without the directory path or ".txt" extension.

For example:

HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools-scm

The Python package will be installed in $(STAGING_DIR_HOSTPKG)/lib/pythonX.Y/site-packages.

Non-Python packages installing host-side Python packages

Non-Python packages can also install host-side Python packages using the same mechanism:

  • Set HOST_PYTHON3_PACKAGE_BUILD_DEPENDS (see above for details).

  • Include python3-package.mk (set PYTHON3_PKG_BUILD:=0 to avoid using the default Python package build recipes).

  • Call Py3Build/InstallBuildDepends to initiate the installation.

For example:

PYTHON3_PKG_BUILD:=0
HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools-scm

include $(INCLUDE_DIR)/package.mk
include ../../lang/python/python3-package.mk
# If outside of the packages feed:
# include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk

define Build/Compile
	$(call Py3Build/InstallBuildDepends)
	$(call Build/Compile/Default)
endef