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

Use Pipfile instead of many requirements.txt files #366

Open
ibnesayeed opened this issue Jan 5, 2018 · 15 comments
Open

Use Pipfile instead of many requirements.txt files #366

ibnesayeed opened this issue Jan 5, 2018 · 15 comments

Comments

@ibnesayeed
Copy link
Member

Pipfile seems to be a more modern approach of maintaining dependencies https://github.com/pypa/pipfile

@machawk1 machawk1 added the Meta label Jan 5, 2018
@machawk1
Copy link
Member

machawk1 commented Jan 5, 2018

Looks like base pip does not support the pipfile format. As far as I am aware, pipenv is not distributed with python like pip, so I think we ought to wait.

@ibnesayeed
Copy link
Member Author

I don't think it is a problem, because it is a development environment setup related matter, it is not something that the user would be concerned.

@machawk1
Copy link
Member

machawk1 commented Aug 8, 2018

it is a development environment setup related matter

Can we still recommend users install ipwb using pip install ipwb if we use a pipfile in lieu of various requirements files (as we currently do)?

@ibnesayeed
Copy link
Member Author

pip install ipwb does not care about the development setup, it installs from the PyPi repo. Dependencies are described in the setup file for that. However, Pipfile allows having different set of dependencies in a single file instead of multiple requirements files. If I remember correctly, there are some commands in Pipfile to synchronize dependencies of setup file.

@machawk1
Copy link
Member

machawk1 commented Aug 8, 2018

@ibnesayeed So, a user will still be able to install using pip?

As I understand from the documentation, eventual support for using pipfiles from pip is planned.

@ibnesayeed
Copy link
Member Author

So, a user will still be able to install using pip?

Indeed!

@machawk1
Copy link
Member

machawk1 commented Aug 8, 2018

Ok, let's proceed on the efforts to use a pipfile then to resolve the variable, multiple requirements files.

@ibnesayeed
Copy link
Member Author

I would suggest putting effort on this along with the migration to Py3 #51.

@ibnesayeed
Copy link
Member Author

@anatoly-scherbakov we would like your thoughts on this thread and potentially moving to poetry instead? We have not used poetry yet, but we certainly would like a better workflow of managing dependencies. Currently, we are making similar changes in two different files.

@machawk1
Copy link
Member

machawk1 commented Jun 8, 2020

As an update, I still could not find a reference stating that pip has native pipfile support yet.

As above, I believe it would be best to use a package manager included with Python rather than requiring the user to install a package manager (e.g., pipenv, poetry) prior to being able to install ipwb.

@ibnesayeed
Copy link
Member Author

As above, I believe it would be best to use a package manager included with Python rather than requiring the user to install a package manager (e.g., pipenv, poetry) prior to being able to install ipwb.

Users should be able to run pip install ipwb (or any other command they might be using to install Python packages) and get it running irrespective of what dependency management system we use, as long as we publish the package in PyPI. The changes will only affect those developers, not users, who want to tinker with the code. I think it is fair to enforce any development workflow that makes the life of maintainers easy and is not too peculiar for new contributors.

@machawk1
Copy link
Member

machawk1 commented Jun 8, 2020

Users should be able to run pip install ipwb...irrespective of what dependency management system we use.

I agree. I am not seeing any indication that running pip install ipwb when using a pipfile to define the requirements is currently supported. poetry seems like a different dependency management system (I could be wrong). I do not see how moving to poetry would allow users to still type pip install ipwb and have ipwb installed on their system.

@ibnesayeed
Copy link
Member Author

I think you are mixing a few things up. Running the command pip install ipwb has nothing to do with this repository and what code or files are present or absent in it here. As long as a well-bundled package is uploaded to PyPI with the name ipwb with its metadata and dependencies described in a format PyPI understands, users running pip install ipwb should have no problem installing it.

If you were to check the code out and from within the code directory run pip install ., then pip command will need the supporting metadata/dependency management files to function properly. However, this falls under the developer workflow, not the user workflow. Developers can be asked to use a different setup, if that makes life of maintainers easier.

Tools like "poetry" allow storing metadata and dependencies in a different file format, but when you package a bundle, they internally create necessary metadata files suitable for PyPI which is ready to upload. Better yet, we can use poetry itself to upload to PyPI. Currently, we are using a combination of setuptools, wheel, and twine to get all these things done.

@anatoly-scherbakov
Copy link
Contributor

@anatoly-scherbakov we would like your thoughts on this thread and potentially moving to poetry instead? We have not used poetry yet, but we certainly would like a better workflow of managing dependencies. Currently, we are making similar changes in two different files.

I apologize for my taking so long to respond: there was a bit of a crunch time at work lately.

I agree with the comments above: indeed, it is not important what tool the package author used to create a pypi package; to do pip install ipwb, the user does not need to install Poetry.

I have not yet had a chance to publish a package to pypi with Poetry, but I believe this is rather straightforward - their main page https://python-poetry.org/ suggests it is as simple as typing poetry publish.

@machawk1
Copy link
Member

machawk1 commented Jun 21, 2020

Related aside, in forking and publishing py-ipfs-http-client to pypi, I used flit as preconfigured by the project and similar to how @anatoly-scherbakov mentioned with poetry, it was as simple as flit publish following the initial flit init, which read the parameters from the pyproject.toml in the root of the repo.

EDIT: We have since moved back to using the externally developed py-ipfs-http-client since they put out another release (re:flit).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants