-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
convert_deps_to_pip function is not available #5040
Comments
@paulcqtruong That is an internal method to Pipenv, can you explain what you use it for? There is a new Otherwise though, that method still exists. Its
|
Closing this as there isn't much pipenv can do -- the utils namespacing is a big improvement to working on the code and has lead to some bug fixing and issue squashing along the way. |
@matteius, I may have an example of a use case:
The last step should also install all dependencies of from setuptools import setup, find_packages
from pipenv.project import Project
from pipenv.utils import convert_deps_to_pip
pfile = Project(chdir=False).parsed_pipfile
requirements = convert_deps_to_pip(pfile["packages"], r=False)
setup(
name="cloudsense-logging",
version="0.1.0",
packages=find_packages(),
install_requires=requirements,
) Is there a better approach that does not make me rely on |
@DSamuylov A few thoughts -- Including code that has to be evaluated, even an interpolated sting, is problematic for the setup.py AST parsers of requirementslib, and unlike pip--it will not evaluate code in the setup.py, so I think you would still have issues with a package setup.py like this if pre-built wheels were not available and a user were to From the sound of your example case, you are developing package_b and managing its dependencies with pipenv Pipfile/lock file and package_a is being developed similar. There is no good way to dynamically and safely evaluate the install_requires at runtime this way, so I recommend not doing this. Also it would be better if the project dependencies were defined in a As far as using the utils from pipenv. you are welcome to do so but they are subject to change and improvements. The utils file was broken into separate files in a utils module to be more organized, that method is still in that module at I took your example and modified it to generate the requirements for pipenv, but there should still be a step of sanitizing it (as
|
@matteius, Thank you a lot for your prompt response, I highly appreciate it! Just before I saw your reply, I was about to write that this approach does not work. I am not sure if it linked to your argument, but from my understanding with such approach there is also a circular requirement to install the dependency: from I had |
Sorry @DSamuylov I think I misspoke this morning about pipenv using pyproject.toml for it install_requires, which is currently a list in setup.py. Requirementslib which pipenv relies on has a pyproject.toml as well, also not defining the required packages, but requirementslib puts them into the setup.cfg https://github.com/sarugaku/requirementslib/blob/main/setup.cfg#L42 |
Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Pipenv.
Check the diagnose documentation for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way.
Make sure to mention your debugging experience if the documented solution failed.
Issue description
The method
pipenv.utils.convert_deps_to_pip
has disappeared in the latest release2022.4.8
Expected result
I can't find any announcement of retiring the function above or proposal of an alternative to
convert_deps_to_pip
Actual result
The exception logs as below
Steps to replicate
If you're on macOS, run the following:
The text was updated successfully, but these errors were encountered: