Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python39: hardcode path to tzdata #103993

Closed
wants to merge 356 commits into from
Closed

python39: hardcode path to tzdata #103993

wants to merge 356 commits into from

Conversation

FRidh
Copy link
Member

@FRidh FRidh commented Nov 16, 2020

Python 3.9 has a new module zoneinfo which requires tzdata. By default
it searches TZPATH for folders containing zoneinfo.

This commit makes the dependency on tzdata pure.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

TODO

  • nuke-refs kills the reference to tzdata. This should not happen

@SuperSandro2000
Copy link
Member

Locally I get a merge conflict when trying to test this PR.

@FRidh FRidh mentioned this pull request Jan 24, 2021
10 tasks
@jonringer
Copy link
Contributor

we may have to do some patching

[nix-shell:/home/jon/.cache/nixpkgs-review/pr-103993]$ ./results/python310/bin/python3
Python 3.10.0a4 (default, Jan  4 2021, 17:26:04)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import zoneinfo
>>> zoneinfo.ZoneInfo("UTC")
Traceback (most recent call last):
  File "/home/jon/.cache/nixpkgs-review/pr-103993/results/python310/lib/python3.10/zoneinfo/_common.py", line 12, in load_tzdata
    return importlib.resources.open_binary(package_name, resource_name)
  File "/home/jon/.cache/nixpkgs-review/pr-103993/results/python310/lib/python3.10/importlib/resources.py", line 40, in open_binary
    package = _common.get_package(package)
  File "/home/jon/.cache/nixpkgs-review/pr-103993/results/python310/lib/python3.10/importlib/_common.py", line 66, in get_package
    resolved = resolve(package)
  File "/home/jon/.cache/nixpkgs-review/pr-103993/results/python310/lib/python3.10/importlib/_common.py", line 56, in resolve
    else importlib.import_module(cand)
  File "/home/jon/.cache/nixpkgs-review/pr-103993/results/python310/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1049, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1026, in _find_and_load
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1049, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1026, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1003, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tzdata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jon/.cache/nixpkgs-review/pr-103993/results/python310/lib/python3.10/zoneinfo/_common.py", line 24, in load_tzdata
    raise ZoneInfoNotFoundError(f"No time zone found with key {key}")
zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key UTC'
>>>

or this may be an issue with upstream, as this doesn't occur in python3.9

@FRidh
Copy link
Member Author

FRidh commented Jan 24, 2021

Should pass -e ${tzdata} to nuke-refs invocation.

@FRidh FRidh added this to the 21.05 milestone Jan 25, 2021
CertainLach and others added 19 commits February 26, 2021 05:49
Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
upstream plasma-browser-integration now depends on libtaskmanager

Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
python3Packages.parso: fix flaky test due to slow moving time
This reverts commit acde9a0.
A better solution is a65208c.
This reverts commit 963513e.
A better solution is a65208c.
github-actions bot and others added 24 commits March 11, 2021 18:23
…otli

stdenv/darwin: allow brotli reference from curl
glib and libqrtr-glib are listed in the Requires field of the pkg-config file so we need to propagate them in order for depenents to be able to use this library.
vala: 0.40.18 -> 0.40.25, 0.46.5 -> 0.46.13, 0.48.9 -> 0.48.14, init 0.50.4
With 20.8 upstream reverted buildsystem from flit back to setuptools as
this would make it easier for some distro's.
because we already have a hook that takes care of it. Note tests were
disabled because of a circular test dependency.
Achieve reproducible builds of the interpreter. Note this meant
disabling optimizations again.
Python 3.9 has a new module `zoneinfo` which requires tzdata. By default
it searches TZPATH for folders containing `zoneinfo`.

This commit makes the dependency on tzdata pure.
@FRidh FRidh changed the title WIP: python39: hardcode path to tzdata python39: hardcode path to tzdata Mar 13, 2021
@FRidh
Copy link
Member Author

FRidh commented Mar 13, 2021

/rebase staging

@FRidh FRidh closed this Mar 13, 2021
@FRidh
Copy link
Member Author

FRidh commented Mar 13, 2021

pushed 7617b03 to staging

@github-actions
Copy link
Contributor

Failed to rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet