poetry-core | Poetry PEP 517 Build Backend & Core Utilities | DevOps library
kandi X-RAY | poetry-core Summary
kandi X-RAY | poetry-core Summary
A PEP 517 build backend implementation developed for Poetry. This project is intended to be a light weight, fully compliant, self-contained package allowing PEP 517 compatible build frontends to build Poetry managed projects.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Decorator to define class attributes .
- Returns a function that converts the attributes to a script .
- Create a new definition .
- Parse a table key .
- Define a new attribute .
- Load grammar .
- Configure a project package .
- Run tests .
- Creates a DependencyTypes instance from a given package name .
- Create a ForwardedByNotation .
poetry-core Key Features
poetry-core Examples and Code Snippets
Community Discussions
Trending Discussions on poetry-core
QUESTION
I want to install packages from poetry.lock
file; using poetry install
.
However, the majority of packages throw the exact same error, indicating a shared fundamental problem.
What is causing this? What is the standard fix?
Specification:
- Windows 10,
- Visual Studio Code,
- Python 3.8.10 & Poetry 1.1.11,
- Ubuntu Bash.
Terminal:
rm poetry.lock
poetry update
poetry install
ANSWER
Answered 2022-Mar-23 at 10:22This looks to be an active issue relating to poetry. See here - Issue #4085. Some suggest a workaround by downgrading poetry-core
down to 1.0.4.
There is an active PR to fix the issue.
QUESTION
When a project is specified only via pyproject.toml
(i.e. no setup.{py,cfg}
files), how can it be installed in editable mode via pip
(i.e. python -m pip install -e .
)?
I tried both setuptools
and poetry
for the build system, but neither worked:
ANSWER
Answered 2022-Mar-19 at 23:06PEP 660 – Editable installs for pyproject.toml based builds defines how to build projects that only use pyproject.toml
. Build tools must implement PEP 660 for editable installs to work. You need a front-end (such as pip ≥ 21.3), backend. The statuses of some popular backends are:
QUESTION
I'm trying to build a Python Plugin for Saleor using Poetry and I'm having issues installing the plugin on Saleor. I run poetry add ../social_auth
to install the plugin on saleor and it succeeds but when I try to run Saleor I get this Error:
ANSWER
Answered 2022-Mar-08 at 02:03The problem was that pyhton couldn't find the plugin source since it wasn't in the PYTHONPATH
and I had to add it to PYTHONPATH
environment variable using this command:
QUESTION
I am running into an error when trying to run my container where it is saying it can't find a module while trying to import. Specifically:
ModuleNotFoundError: No module named 'sentry_sdk'
The following is my DockerFile which is a multistage build, it seems to install all the packages according to the console output.
...ANSWER
Answered 2022-Feb-18 at 17:05OK I figured it out and now I feel dumb.
The issue was indeed related to the venv, basically, uvicorn is installed on the base image but not in my pyproject.toml. So poetry didn't install it in the venv. When I started the app in the Dockerfile using CMD it couldn't find uvicorn in the venv so went to the base install and ran from there. When I added uvicorn to the venv it all worked fine.
QUESTION
Does it make sense to use Conda + Poetry for a Machine Learning project? Allow me to share my (novice) understanding and please correct or enlighten me:
As far as I understand, Conda and Poetry have different purposes but are largely redundant:
- Conda is primarily a environment manager (in fact not necessarily Python), but it can also manage packages and dependencies.
- Poetry is primarily a Python package manager (say, an upgrade of pip), but it can also create and manage Python environments (say, an upgrade of Pyenv).
My idea is to use both and compartmentalize their roles: let Conda be the environment manager and Poetry the package manager. My reasoning is that (it sounds like) Conda is best for managing environments and can be used for compiling and installing non-python packages, especially CUDA drivers (for GPU capability), while Poetry is more powerful than Conda as a Python package manager.
I've managed to make this work fairly easily by using Poetry within a Conda environment. The trick is to not use Poetry to manage the Python environment: I'm not using commands like poetry shell
or poetry run
, only poetry init
, poetry install
etc (after activating the Conda environment).
For full disclosure, my environment.yml file (for Conda) looks like this:
...ANSWER
Answered 2022-Feb-14 at 10:04As I wrote in the comment, I've been using a very similar Conda + Poetry setup in a data science project for the last year, for reasons similar to yours, and it's been working fine. The great majority of my dependencies are specified in pyproject.toml
, but when there's something that's unavailable in PyPI, I add it to environment.yml
.
Some additional tips:
- Add Poetry, possibly with a version number (if needed), as a dependency in
environment.yml
, so that you get Poetry installed when you runconda env create
, along with Python and other non-PyPI dependencies. - Consider adding
conda-lock
, which gives you lock files for Conda dependencies, just like you havepoetry.lock
for Poetry dependencies.
QUESTION
I have a trivial python lambda function defined in index.py
:
ANSWER
Answered 2022-Jan-11 at 23:44If you create a v-env with PsycoPG2 installed, you'll see that that's pretty much the minimum you can get away with due to the size of the components of the wheel and its dependencies
While it's not 100% the same as 2.9, here's mine for 2.9.1:
QUESTION
I've read dozens of articles, blog posts, docs, and Q&A posts on this site on this issue, and I haven't found a solution.
My Python code in index.py
is simple:
ANSWER
Answered 2022-Jan-11 at 20:29This is a bug in CDK that's still to be patched in the next release. Downgrade to 1.136
if using CDK v1, or the 2.3.0-alpha.0
version of @aws-cdk/aws-lambda-python-alpha
if using CDK v2.
UPDATE: The 1.139 CDK release fixes the issue.
QUESTION
I'm using poetry 1.1.12 with python 3.10. My project depends on numpy 1.21.1 that takes 5 minutes to install each time I run my continuous integration pipeline.
Is there a way to make poetry use some kind of compiled numpy package instead of rebuilding it each build ?
I've already mitigated this issue by caching my virtual environment repository following steps described in this answer, but I want a solution that works even if I change my poetry.lock
file or if my cache is expired.
I can only use ubuntu-latest
image in github actions due to corporate policy rules
ANSWER
Answered 2021-Dec-21 at 08:40Poetry uses precompiled packages per default if exists. Setting an upper limit on python version made my build use more recent version of numpy that is already precompiled for my version of python
Before numpy 1.21.2, only minimum version of python was set. Numpy 1.21.1 requires python version greater than 3.7
But since numpy 1.21.2, there is also a maximum version of python. Numpy 1.21.2 (to 1.21.5 as time of writing this answer) requires python version greater than 3.7 but strictly lower than 3.11. Here is a summary of numpy/python compatibility:
numpy version python version 1.21.0 Python >=3.7 1.21.1 Python >=3.7 1.21.2 Python >=3.7, <3.11 ... ... 1.21.5 Python >=3.7, <3.11In my pyproject.toml
, I've set the python version as follows:
QUESTION
I've been working on a project which so far has just involved building some cloud infrastructure, and now I'm trying to add a CLI to simplify running some AWS Lambdas. Unfortunately both the sdist and wheel packages built using poetry build
don't seem to include the dependencies, so I have to manually pip install
all of them to run the command. Basically I
- run
poetry build
in the project, cd "$(mktemp --directory)"
,python -m venv .venv
,. .venv/bin/activate
,pip install /path/to/result/of/poetry/build/above
, and then- run the new .venv/bin/ executable.
At this point the executable fails, because pip
did not install any of the package dependencies. If I pip show PACKAGE
the Requires
line is empty.
The Poetry manual doesn't seem to specify how to link dependencies to the built package, so what do I have to do instead?
I am using some optional dependencies, could that be interfering with the build process? To be clear, even non-optional dependencies do not show up in the package dependencies.
pyproject.toml:
...ANSWER
Answered 2021-Nov-04 at 02:15This appears to be a bug in Poetry. Or at least it's not clear from the documentation what the expected behavior would be in a case such as yours.
In your pyproject.toml
, you specify two dependencies as required in this section:
QUESTION
Trying out poetry 1.1.11 and have pandas in my pyproject.toml in the tool.poetry.dependencies section. Pandas depends on numpy
...ANSWER
Answered 2021-Oct-19 at 03:21The suggestion in the help text above addresses the issue. poetry add numpy
works in an empty project with this TOML change.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install poetry-core
You can use poetry-core like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page