Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Is 'dephell package install -e .' a thing? #385

Closed
agritheory opened this issue Feb 14, 2020 · 9 comments · Fixed by #398
Closed

Is 'dephell package install -e .' a thing? #385

agritheory opened this issue Feb 14, 2020 · 9 comments · Fixed by #398
Labels
command request for a new command enhancement New feature or request

Comments

@agritheory
Copy link

Short description

How does one install their own package, eg pip install -e .?

Output

$ dephell package install -e .
WARNING cannot find config file 
WARNING empty root passed 
INFO build dependencies graph... 
INFO installation... (executable=redeacted/rww1/main/bin/python3.8, packages=0)
INFO installed 
@orsinium
Copy link
Member

This works for me:

dephell package install -- "-e $(pwd)"

However, I don't think it's how it should be. Let's figure out something better like introducing a new command for this.

@orsinium orsinium added command request for a new command enhancement New feature or request labels Mar 12, 2020
@agritheory
Copy link
Author

However, I don't think it's how it should be. Let's figure out something better like introducing a new command for this.

A proposal: dephell package install your_pacakge_name

I think combinations of . or -e are out of context here because they're not dephell commands and dephell doesn't use anything like pip's CLI terminology (not a criticism, just a fact). This may require referencing something in the config, which turns this into two steps but I think is still better than being ambiguous.

@orsinium
Copy link
Member

A proposal: dephell package install your_pacakge_name

It should be more explicit. It's not a good idea to implicitly mix dev and non-dev installation. When I git clone a package, sometimes I install it as is, sometimes I install it as editable.

dephell doesn't use anything like pip's CLI terminology (not a criticism, just a fact)

That's the best compliment :)

Could you tell me a bit about your use case, please?

@agritheory
Copy link
Author

It should be more explicit. It's not a good idea to implicitly mix dev and non-dev installation. When I git clone a package, sometimes I install it as is, sometimes I install it as editable.

This makes sense to me. I think the most intuitive options would then be something in the vein of --self or (sigh) -e.

RE use case: I'm working on an ORM and to do integration testing, I was trying to install it in the Docker environment, make it play nice with Tox, etc... I would think any kind of library development use case would be in scope here, but maybe there's a better workflow I'm not seeing. Please note that I would not consider this ready for release, and I've documented some things that will/should work that I haven't implemented yet.

@orsinium
Copy link
Member

orsinium commented Mar 12, 2020

If you want to install project dependencies, use dephell deps install. If you want to use your package for testing, it's available from import when you in the project root dir. You need an editable installation only if you want to reuse the package in other packages or projects on your system. For example, I have dephell_venv installed in editable mode to be able to change something in it and immediately work with these changes in DepHell itself.

@orsinium
Copy link
Member

Ah, I see, I guess. Add __init__.py into tests directory. It will fix project lookup for pytest :)

@agritheory
Copy link
Author

@orsinium This is way more of a solution than I was expecting, thank you. What do you need for documentation and how could I try it out?

@orsinium
Copy link
Member

how could I try it out?

curl -L dephell.org/install > install.py
python3 install.py --branch=project-dev

https://dephell.readthedocs.io/installation.html#get-development-version

What do you need for documentation

I've done docs, thanks. If you want to help with the project, feel free to grab any open issue ;)

I'll merge it in a few days and make a release soon. Our twitter is a good way to not miss releases.

@agritheory
Copy link
Author

Four hours later and it's already been merged to master... under promise, over deliver.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
command request for a new command enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

2 participants