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

How to start? (CALL FOR COMMUNITY ARTICLES) #348

Open
michaelaye opened this issue Dec 27, 2019 · 17 comments
Open

How to start? (CALL FOR COMMUNITY ARTICLES) #348

michaelaye opened this issue Dec 27, 2019 · 17 comments
Labels
docs documentation improvements good first issue Good for newcomers Hacktoberfest Newbies friendly and prioritized review <3 help wanted Extra attention is needed

Comments

@michaelaye
Copy link

Short description

I'm trying to get into using dephell but the lack of a minimal working example is hindering my grokking it.

I was going here as it's the first example:

https://dephell.readthedocs.io/use-warehouse.html

and tried to execute the first line:

dephell inspect config --filter="warehouse"
WARNING cannot find config file
ERROR KeyError: '"warehouse"'

which I guess means that this example is not self-consistent? I fail to fully understand how to productively start with dephell currently.
Would it be easiest/fastest to start from a working setup.py file?

I learn mostly by example, so I think what would be really helpful for people getting into it would be a set of the following tutorials:

  1. Minimal example using only dephell to make a package installable
  2. Make it distributable via pypi
  3. Add conda package generation.

At least in my world (astronomy/planetary), pypi and conda are the most used way to disseminate new packages.

@michaelaye
Copy link
Author

Another issue I have is that poetry is being referenced a lot, so do I first need to learn what poetry is and does before I can use dephell? It kinda looks like that. So far, I'm only using setup.py, but there a lot of discussion has started around *_requires and its security issues, and as we are designing a new community Python package, I'd like to go the most future proof way to do this, and dephell seemed like a good candidate as it supports a lot of existing package dissemination formats.

@orsinium
Copy link
Member

Please, use quick start:

https://dephell.readthedocs.io/#quick-start

Make it distributable via pypi

DepHell is available on pypi. However, it's not the recommended way to install it.

@orsinium
Copy link
Member

so do I first need to learn what poetry is and does before I can use dephell?

You should know any dependency format. Setup.py is a bad choice because dephell can't modify it. But for most commands it's ok. Flit is a good choice for nice and simple format.

@michaelaye
Copy link
Author

michaelaye commented Dec 27, 2019

I saw quick start but it doesn’t help much in my opinion as the converter is so complex and goes into so many different potential lines of progress it’s more confusing than quick-starting.

My sequence of requested tutorials was about a candidate package to distribute, not about dephell itself, sorry if that wasn’t clear.

So,

  1. Make “package” installable with minimal dephell config
  2. Then add pypi distribution to “package”
  3. Finally, add conda package generation to ”package”

That should cover most use cases for people like me (scientists forced to be devs)

@orsinium
Copy link
Member

Hmm, that makes sense. A lot of sense. I think it should be an article.

@orsinium orsinium changed the title DOCS: How to start? First line of examples fails. How to start? Dec 27, 2019
@orsinium orsinium added docs documentation improvements help wanted Extra attention is needed good first issue Good for newcomers Hacktoberfest Newbies friendly and prioritized review <3 labels Dec 27, 2019
@orsinium
Copy link
Member

Hmm. I've put a lot of labels here. I will do an article by myself but this is the point where I expect community help most. I'll be happy to see third-party articles about DepHell and promote them in the readme and docs.

@michaelaye
Copy link
Author

I’ll be happy to promote once I understand it myself! :)

@orsinium
Copy link
Member

A few points that could be a good thing to talk about:

  1. Quick start with zero knowledge in packaging. dephell deps convert --from=imports --to=setup.py is a really magic and underestimated thing. It can do a package from nothing!
  2. Dependency formats. Why setup.py is difficult and obsolete, why flit deserves no less attention than poetry (I haven't affiliated with any of them).
  3. Why many environments and isolations are a good thing. DepHell's philosophy is to keep a separate virtual environment and dependencies for every tool. None of the tools in Python do this. Pipenv, poetry and so on assumes that you have one venv per project.
  4. A little bit about jail. Why CLI tools isolation is so important.
  5. project bump has a cool long documentation about different versioning schemes. I did a talk about it and it had a lot of positive feedback. So, it can be turned into a cool article.

I'm going to do a talk on Moscow Python Conf++, and after it some parts of the talk can be turned into articles as well.

@orsinium orsinium changed the title How to start? How to start? (CALL FOR COMMUNITY ARTICLES) Dec 27, 2019
@orsinium orsinium pinned this issue Dec 27, 2019
@michaelaye
Copy link
Author

3: pipx seems to do this?

@orsinium
Copy link
Member

Popx and pipsi are about global cli tools, like jail in dephell. The third point, however, about per-project tools and checks like pytest with all required dependencies inside.

@halhenke
Copy link

halhenke commented Jan 2, 2020

I particularly think some documentation on the configuration options would be useful - and some stuff on exactly what mutation/layers means.

Actually just looking through the doc folder I see there is a lot more info on individual commands that otherwise is not obvious to find - particularly if, like myself, you start reading the docs at the "Main Info" section.

Quick start with zero knowledge in packaging. dephell deps convert --from=imports --to=setup.py is a really magic and underestimated thing. It can do a package from nothing!

If i am understanding you correctly that is indeed very cool - and I had no idea dephell could do that.

@orsinium
Copy link
Member

orsinium commented Jan 2, 2020

Layers are layers in your dependency graph. In the center is your project (or more virtual projects if you are merging two dependency files), it's zero layer. The first layer is your project direct dependencies that you explicitly specified. The second layer is dependencies of dependencies and so on. Graph is cyclic directed, we can handle cycles as well.

Mutations hapoen when we faced with dependencies conflict. DepHell is the only tool that values "as few network requests as possible" over "as few mutations as possible". In some cases it is the same but not always. So, you can see a lot of mutations happen in a row. No worries about it, dephell never repeats the same mutation twice. Mutations stop when the conflict is reconflict resolved or dephell tried to many mutations (200 by default) without success. In the second case you get the conflict report.

@orsinium
Copy link
Member

orsinium commented Jan 2, 2020

Actually just looking through the doc folder I see there is a lot more info on individual commands

DepHell had one-level menu before, with all commands listed. Now it's grouped because feedback showed it scares newcomers. It's hard to make friendly docs for such a big tool that can do everything but I try my best. Docs for dephell project bump my favorite.

@orsinium
Copy link
Member

orsinium commented Jan 2, 2020

Ask more, let's see what is missed

@mfoglio
Copy link

mfoglio commented May 23, 2020

Hi, I am new to dephell. Good project! I am struggling a little bit with the documentation. In particular, I'd like to understand what is the current docker support. I've been able to create a docker image using dephell docker create. However, this image does not contain the packages installed in the venv ( dephell deps install ). Is there a way to do it?

@orsinium
Copy link
Member

@mfoglio, that's a good catch. Right, there is no built-in way to install deps into docker yet. And it is definitely in the plans. I've seen a few projects using dephell, they use on of the next solutions:

  1. Convert deps into requirements.txt and do dephell docker run pip install
  2. Install dephell inside and call dephell docker run dephell deps install

As I said, direct support is certainly should be implemented soon, these workarounds too verbose but that's what we have now.

@mfoglio
Copy link

mfoglio commented May 23, 2020

Do you think it would be difficult to implement this? I can try to get my hands dirty, but I've never contributed to an open-source project before so I would need some guidance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
docs documentation improvements good first issue Good for newcomers Hacktoberfest Newbies friendly and prioritized review <3 help wanted Extra attention is needed
Development

No branches or pull requests

4 participants