Giter VIP home page Giter VIP logo

Comments (8)

jsirois avatar jsirois commented on August 14, 2024

@NiklasRosenstein modern Pex supports many --pip-version values. Perhaps try --pip-version latest.

The key concept with Pex to keep in mind is I never break existing users. That means, as I add features, the old defaults remain the same as they did in the past; so sometimes you need to use --help to discover these new, non-default, features. In this particular case, the default Pip is ~3 years old, 20.3.4.

from pex.

jsirois avatar jsirois commented on August 14, 2024

It looks like your version supports Pip 23.1.2:
https://github.com/pantsbuild/pex/blob/b17ab8ebb667a940da999f592a87a4c76d3dc1ea/pex/pip/version.py#L141-L149

If you upgrade to newer versions of Pex you get 23.2+ support which also means Python 3.12 support (up through the very latest Pip release in fact).

from pex.

jsirois avatar jsirois commented on August 14, 2024

@NiklasRosenstein what version of python are you using here? It's hard to repro without that key detail.

from pex.

jsirois avatar jsirois commented on August 14, 2024

Ok, here's what I find guessing Python 3.8:

$ pex -V
2.1.156
$ pex --python python3.8 novella==0.2.6 mkdocs mkdocs-material pydoc-markdown==4.8.2 -c novella --pip-version vendored
Failed to resolve compatible distributions:
1: databind.core==4.4.2 requires typing-extensions<4.7,>=3.10.0 but typing_extensions 4.9.0 was resolved
2: databind.json==4.4.2 requires typing-extensions<4.7,>=3.10.0 but typing_extensions 4.9.0 was resolved
$ pex --python python3.8 novella==0.2.6 mkdocs mkdocs-material pydoc-markdown==4.8.2 -c novella --pip-version 23.1.2
Failed to resolve compatible distributions:
1: databind.core==4.4.2 requires typing-extensions<4.7,>=3.10.0 but typing_extensions 4.9.0 was resolved
2: databind.json==4.4.2 requires typing-extensions<4.7,>=3.10.0 but typing_extensions 4.9.0 was resolved
$ pex --python python3.8 novella==0.2.6 mkdocs mkdocs-material pydoc-markdown==4.8.2 -c novella --pip-version 23.2
Traceback (most recent call last):
  File "/home/jsirois/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/jsirois/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/tmptksuwj39/__main__.py", line 106, in <module>
    bootstrap_pex(__entry_point__, execute=__execute__, venv_dir=__venv_dir__)
  File "/tmp/tmptksuwj39/.bootstrap/pex/pex_bootstrapper.py", line 627, in bootstrap_pex
    pex.PEX(entry_point).execute()
  File "/tmp/tmptksuwj39/.bootstrap/pex/pex.py", line 561, in execute
    sys.exit(self._wrap_coverage(self._wrap_profiling, self._execute))
  File "/tmp/tmptksuwj39/.bootstrap/pex/pex.py", line 468, in _wrap_coverage
    return runner(*args)
  File "/tmp/tmptksuwj39/.bootstrap/pex/pex.py", line 499, in _wrap_profiling
    return runner(*args)
  File "/tmp/tmptksuwj39/.bootstrap/pex/pex.py", line 605, in _execute
    return self.execute_entry(
  File "/tmp/tmptksuwj39/.bootstrap/pex/pex.py", line 774, in execute_entry
    return self.execute_entry_point(entry_point)
  File "/tmp/tmptksuwj39/.bootstrap/pex/pex.py", line 792, in execute_entry_point
    return runner()
  File "/home/jsirois/.pex/installed_wheels/bbc350f9f1db71ebbc2a08cc3e4674a96af20a54fffb098634b4ddda2c5f1230/novella-0.2.6-py3-none-any.whl/novella/__main__.py", line 184, in main
    raise exception
  File "/home/jsirois/.pex/installed_wheels/bbc350f9f1db71ebbc2a08cc3e4674a96af20a54fffb098634b4ddda2c5f1230/novella-0.2.6-py3-none-any.whl/novella/__main__.py", line 172, in main
    context = novella.execute_file(args.config_file, code)
  File "/home/jsirois/.pex/installed_wheels/bbc350f9f1db71ebbc2a08cc3e4674a96af20a54fffb098634b4ddda2c5f1230/novella-0.2.6-py3-none-any.whl/novella/novella.py", line 47, in execute_file
    Closure(None, None, context).run_code(code if code is not None else file.read_text(), str(file))
  File "/home/jsirois/.pyenv/versions/3.8.18/lib/python3.8/pathlib.py", line 1236, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
  File "/home/jsirois/.pyenv/versions/3.8.18/lib/python3.8/pathlib.py", line 1222, in open
    return io.open(self, mode, buffering, encoding, errors, newline,
  File "/home/jsirois/.pyenv/versions/3.8.18/lib/python3.8/pathlib.py", line 1078, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: 'build.novella'

So, you need at least Pip 23.2 to get a successful resolve and it appears novella is broken.

from pex.

jsirois avatar jsirois commented on August 14, 2024

@NiklasRosenstein actually your current Pex works, but you need to specify 2 non-default options --pip-version latest --resolver-version pip-2020-resolver:

$ pex --python python3.8 pex==2.1.136 -cpex -- novella==0.2.6 mkdocs mkdocs-material pydoc-markdown==4.8.2 -c novella --pip-version latest --resolver-version pip-2020-resolver
...
  File "/home/jsirois/.pex/installed_wheels/bbc350f9f1db71ebbc2a08cc3e4674a96af20a54fffb098634b4ddda2c5f1230/novella-0.2.6-py3-none-any.whl/novella/__main__.py", line 184, in main
    raise exception
  File "/home/jsirois/.pex/installed_wheels/bbc350f9f1db71ebbc2a08cc3e4674a96af20a54fffb098634b4ddda2c5f1230/novella-0.2.6-py3-none-any.whl/novella/__main__.py", line 172, in main
    context = novella.execute_file(args.config_file, code)
  File "/home/jsirois/.pex/installed_wheels/bbc350f9f1db71ebbc2a08cc3e4674a96af20a54fffb098634b4ddda2c5f1230/novella-0.2.6-py3-none-any.whl/novella/novella.py", line 47, in execute_file
    Closure(None, None, context).run_code(code if code is not None else file.read_text(), str(file))
  File "/home/jsirois/.pyenv/versions/3.8.18/lib/python3.8/pathlib.py", line 1236, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
  File "/home/jsirois/.pyenv/versions/3.8.18/lib/python3.8/pathlib.py", line 1222, in open
    return io.open(self, mode, buffering, encoding, errors, newline,
  File "/home/jsirois/.pyenv/versions/3.8.18/lib/python3.8/pathlib.py", line 1078, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: 'build.novella'

At the --pip-version 23.2 cutoff, Pip dropped support for their legacy resolver; so you no longer need to tell Pex --resolver-version pip-2020-resolver to move away from the old default of --resolver-version pip-legacy-resolver (Pip maintained both resolvers internally for some time during their transition; so Pex did as well, defaulting to the original legacy as long as it could).

from pex.

jsirois avatar jsirois commented on August 14, 2024

@NiklasRosenstein I've labelled this a question and I'd like to close as answered, since I think using --pip-version and --resolver-version solves your problem. Please let me know one way or the other if this solves your problem.

from pex.

jsirois avatar jsirois commented on August 14, 2024

Aha, novella is not broken, it just expects a novella.build file in CWD. A better example:

$ pex --python python3.8 pex==2.1.136 -cpex -- novella==0.2.6 mkdocs mkdocs-material pydoc-markdown==4.8.2 -c novella --pip-version latest --resolver-version pip-2020-resolver -- --version
0.2.6

from pex.

NiklasRosenstein avatar NiklasRosenstein commented on August 14, 2024

Thanks for the detailed response @jsirois! Indeed it works with --pip-version latest --resolver-version pip-2020-resolver. It takes quite a while longer to build (130s vs. 50s) but I suppose that's the trade off of relying on resolution and not using exact constraints. Probably the would-be conflict takes extra time to resolve

Edit: Running the second time it seems we're back to 50s

from pex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.