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

lektor: fix "ImportError: No module named pkg_resources" #85472

Merged
merged 1 commit into from Apr 21, 2020

Conversation

das-g
Copy link
Member

@das-g das-g commented Apr 18, 2020

Motivation for this change

Without this change, the lektor command fails with

Traceback (most recent call last):
  File "/nix/store/5m4zpcdvvg87yyhizqh0jg9b1q53qm9r-python3.7-lektor-3.1.3/bin/.lektor-wrapped", line 7, in <module>
    from lektor.cli import main
  File "/nix/store/3i5djvb74iwng1mmmcm059i3sdn0py0b-python3-3.7.5-env/lib/python3.7/site-packages/lektor/cli.py", line 8, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
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.

Result of nixpkgs-review 1

3 package built:
  • python27Packages.lektor
  • python37Packages.lektor
  • python38Packages.lektor

@das-g
Copy link
Member Author

das-g commented Apr 20, 2020

Result of nixpkgs-review pr 85472 1 for 4a516c0

3 package built:
  • python27Packages.lektor
  • python37Packages.lektor
  • python38Packages.lektor

results/python27Packages.lektor/bin/lektor

outputs a warning about a Setuptools / Python 2 version mismatch:
/nix/store/lkgv7xl8kl5acb9vxc1qrwqw9x59b313-python3.8-setuptools-45.2.0/lib/python3.8/site-packages/pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2
************************************************************
You are running Setuptools on Python 2, which is no longer
supported and
>>> SETUPTOOLS WILL STOP WORKING <<<
in a subsequent release (no sooner than 2020-04-20).
Please ensure you are installing
Setuptools using pip 9.x or later or pin to `setuptools<45`
in your environment.
If you have done those things and are still encountering
this message, please comment in
https://github.com/pypa/setuptools/issues/1458
about the steps that led to this unsupported combination.
************************************************************
  sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
Usage: lektor [OPTIONS] COMMAND [ARGS]...

  The lektor management application.

  This command can invoke lektor locally and serve up the website.  It's
  intended for local development of websites.

Options:
  --project PATH   The path to the lektor project to work with.
  --language TEXT  The UI language to use (overrides autodetection).
  --version        Show the version and exit.
  --help           Show this message and exit.

Commands:
  build              Builds the entire project into the final artifacts.
  clean              Cleans the entire build folder.
  content-file-info  Provides information for a set of lektor files.
  deploy             Deploy the website.
  dev                Development commands.
  plugins            Manages plugins.
  project-info       Shows the info about a project.
  quickstart         Starts a new empty project.
  server             Launch a local server.

@FRidh FRidh merged commit 5dc6f02 into NixOS:master Apr 21, 2020
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

3 participants