Comments (8)
@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.
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.
@NiklasRosenstein what version of python are you using here? It's hard to repro without that key detail.
from pex.
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.
@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.
@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.
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.
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)
- Trying to use pex to build a ML runtime. HOT 3
- unable to create pex with --no-build flag from lockfile HOT 2
- `--no-pre-install-wheels --requirements-pex .. --layout packed` gives `[Errno 21] Is a directory: '.../.deps/....whl'` errors HOT 3
- Incompatible Python version + `--complete-platforms ...` + `--lock ...` + empty cache gives seemingly-spurious "requires different Python" errors HOT 2
- Regression in pex lock create when used with jupyter-cadquery package HOT 4
- ValueError: invalid literal for int() with base 10 during pex build HOT 5
- How to bootstrap external pex files within running Python interpreter HOT 23
- Finalize Python 3.13 support HOT 1
- Build fails/incomplete on requirements.txt schema not followed correctly HOT 9
- Allow subsetting a PEX lockfile in PEX format, not just pip HOT 12
- Support for pip-compile generated requirements with hashes HOT 8
- bdist_pex called from tox fails with python 3.12 HOT 7
- Regression of artifact URL due to change since pip 23.3 HOT 12
- Monkey patch warning when using PEX to run a gunicorn app HOT 6
- `pex3 lock export` can turn VCS requirements into PyPI ones, resulting in hash failures HOT 3
- A way to configure sys.executable flags at PEX runtime HOT 8
- Add support for `--override`ing transitive dependencies. HOT 1
- Add `--provided`: like `--exclude`, but require the excluded project is available at boot time.
- "Resolving wheels disallowed" error when using `--lock` and `--only-binary` HOT 3
- Add more distribution metadata parsing context to failures.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pex.