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

back to poetry #1133

Merged
merged 2 commits into from
Nov 7, 2022
Merged

back to poetry #1133

merged 2 commits into from
Nov 7, 2022

Conversation

willmcgugan
Copy link
Collaborator

Reverting Hatch, which has issues.

  • Lack of a lock file is problematic. No reproducible test environments?
  • Dave's tooling failed (surely fixable on our side, but a problem non-the-less)
  • Bit of a puzzle how to update dependancies when in hatch shell. pip install -e . didn't work.
  • Struggled to publish
dist/textual-0.4.0a1.tar.gz ... already exists
dist/textual-0.4.0a1-py3-none-any.whl ... failed
The read operation timed out

Not sure what this was. This did actually add an entry on PyPi.

Subsequent publish commands failed entirely:

❯ hatch publish
dist/textual-0.4.0a2.tar.gz ... failed
The read operation timed out

Not sure if that was a temporary glitch.

Our conclusion is that maybe Hatch isn't for us, for now at least. Open to using it in the future.

@willmcgugan willmcgugan merged commit f474222 into main Nov 7, 2022
@willmcgugan willmcgugan deleted the revert-to-poetry branch November 7, 2022 16:52
@ofek
Copy link
Contributor

ofek commented Nov 24, 2022

Aww, I wish you would've pinged me to help, I'm in your Discord too

  • Lack of a lock file is problematic. No reproducible test environments?

    As mentioned in Update package metadata and dev experience #971 that is preferred for libraries

  • Dave's tooling failed

    Dunno what that means

  • Bit of a puzzle how to update dependancies when in hatch shell. pip install -e . didn't work.

    You have to modify the dependencies in pyproject.toml

  • Struggled to publish The read operation timed out

    That is a poor error, I will improve it, sorry about that. My assumption is PyPI was having an incident at that time

@darrenburns
Copy link
Member

@ofek We probably merged the Hatch PR too quickly, before we got the chance to understand how our workflows would change.

IMO we should've kept the Hatch PR unmerged and made sure we all understood how it works before merging.

It got merged, personal workflows broke, and we couldn't work it out using the docs. Unable to work things out quickly (and feeling quite blocked), we reverted.

One issue I had was this (I'm probably missing something, but I couldn't find anything in the docs to answer this):

You have to modify the dependencies in pyproject.toml

I don't understand this - if I'm in hatch shell, and I update pyproject.toml, then I run my Textual app using python my/textual/app.py, are the dependencies supposed to be updated magically? It seemed to me like I would have to prefix my commands with hatch run in order to force this sync, which almost seemed to defeat the purpose of using hatch shell.

To get my dependencies to update I ended up running something like hatch run echo, which seemed to trigger a sync. In Poetry I can run a specific command to sync my dependencies e.g. poetry install.

Having to prefix with hatch run made me feel like I was missing something.

I remember reading this part of the docs and feeling confused. How does it keep it in sync? When does it sync? As someone coming using poetry shell this wasn't clear to me.

@davep
Copy link
Contributor

davep commented Nov 24, 2022

On top of what Darren says, this part:

Dave's tooling failed

likely relates to the fact that I couldn't figure out any way to get Hatch to create the venv in a location of my choice; I couldn't find anything akin to PIPENV_VENV_IN_PROJECT or POETRY_VIRTUALENVS_IN_PROJECT which had knock-on effects for auto-virtualenv. While I'm sure I could have configured auto-virtualenv some way, it wasn't making for a frictionless development experience. While doubtless not a showstopper, it's noted as it was another thing to consider if making any switch and for the moment it was easier for us to roll back and look again at some point in the future.

@ofek
Copy link
Contributor

ofek commented Nov 24, 2022

How does it keep it in sync?

Using pip, with the currently defined project dependencies (if installed and in dev mode) and environment dependencies.

When does it sync?

When spawning a shell or running commands. See also the environment life cycle.

couldn't figure out any way to get Hatch to create the venv in a location of my choice; I couldn't find anything akin to PIPENV_VENV_IN_PROJECT or POETRY_VIRTUALENVS_IN_PROJECT

Docs here and even a section of a blog post here.

@davep
Copy link
Contributor

davep commented Nov 24, 2022

Docs here and even a section of a blog post here.

Yeah, saw the docs at the time but still wasn't really clear on how to configure it, not in a way that wasn't imposed on others (eg: I might prefer a .venv in the project but I wouldn't wish to impose that on anyone else). If it is telling me how I can do that I'm going to have to admit to a comprehension problem when it comes to me reading the docs.

@ofek
Copy link
Contributor

ofek commented Nov 24, 2022

wasn't really clear on how to configure it, not in a way that wasn't imposed on others

Option 2 in https://hatch.pypa.io/latest/plugins/environment/virtual/#location links to https://hatch.pypa.io/latest/config/hatch/#environments and if you scroll to the top you'll see Hatch config is (necessarily) per user.

@darrenburns
Copy link
Member

@ofek If I'm using hatch shell, when I change a dependency specifier and wish to re-sync, running the next command with hatch run prefixed (awkward, since most commands I run are taken from my shell history) or exiting the shell and re-entering with hatch shell (not a big deal, just felt like I was missing something coming from poetry shell) is how I should trigger a sync?

It just seemed strange that there's no hatch sync command - the quickest way to force a re-sync seemed basically to run hatch run echo.

I would like to give Hatch another go in a library I'm planning to release soon, so just want to make sure I understand.

@ofek
Copy link
Contributor

ofek commented Nov 24, 2022

Hmm, I guess I could add a hatch env sync command.

@ofek
Copy link
Contributor

ofek commented Nov 25, 2022

Struggled to publish The read operation timed out

That is a poor error, I will improve it

pypa/hatch#619

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

Successfully merging this pull request may close these issues.

4 participants