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

[Tidy] Remove pip as dependency and fully switch to uv #738

Merged
merged 20 commits into from
Sep 25, 2024

Conversation

antonymilne
Copy link
Contributor

@antonymilne antonymilne commented Sep 23, 2024

How to review

The only files that have changed in an interesting way are github workflows, pyproject.toml and hatch.toml files. The rest is just minor linting stuff mainly from fixing isort so you can just ignore.

Description

Some tidying in preparation for updating the contribution guidelines (will follow in a separate PR). There's no user-facing changes. Major developer-facing changes are:

Minor developer-facing changes are:

  • Python 3.11 is now the default version we develop with. Having a consistent version removes a very slight inconsistency around schema generation
  • largely reverted Tidy schema linting #136 so that lint no longer has its own environment. hatch run lint still works the same as before, but now you can do e.g. hatch run lint mypy again
  • we now use ruff for formatting instead of black (almost exactly the same but we can now lint code in docstrings too)
  • pyproject.toml ruff config for vizro-ai and vizro-core extend the base one
  • lots of small fixes for linting that wasn't actually running correctly before e.g. isort

What should I do as a developer?

All this will be made clear in the contributors guide, but in brief:

  1. Make sure you've upgraded to the latest hatch
    • easiest way is try to run hatch self update
    • if that doesn't work then you're using a version of hatch for which hatch self doesn't yet exist so can do it by upgrading with brew or pipx or whatever you used to install hatch in the first place. After that, any future upgrades you can do with hatch self update
    • or just completely remove hatch and reinstall from scratch (this is what I did. There's a GUI to do this now and it's super easy and just takes a couple of seconds)
  2. Don't use pip while you're developing vizro. If you need pip-like functionality within vizro then instead do hatch run pip, e.g. pip install x becomes hatch run pip install x. This will run uv under the hood (no need to install uv though). Using pip without hatch run will not work well
  3. Everything else should work exactly the same as before
  4. Optional:
    • cleanse your computer, your life and your soul by entirely removing your system-wide python, conda, pip
    • install uv (super quick and easy)
    • use uv across your whole computer - no need to interact with pip ever again! If you need pip-like functionality then use uv pip instead (you can make an alias to do this). If you need a virtual environment then use uv venv. If you need tools then use uvx. Life will be good, I promise!

Notice

  • I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

    • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
    • I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorized to submit this contribution on behalf of the original creator(s) or their licensees.
    • I certify that the use of this contribution as authorized by the Apache 2.0 license does not violate the intellectual property rights of anyone else.
    • I have not referenced individuals, products or companies in any commits, directly or indirectly.
    • I have not added data or restricted code in any commits, directly or indirectly.

@github-actions github-actions bot added the Vizro-AI 🤖 Issue/PR that addresses Vizro-AI package label Sep 23, 2024
Copy link
Contributor

@maxschulz-COL maxschulz-COL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Cool stuff! For me the GUi installation did not work after remove the homebrew one, but after reverting to homebrew, all is good with my initial setup :)

vizro-core/src/vizro/models/_base.py Outdated Show resolved Hide resolved
@antonymilne antonymilne changed the title [Tidy] contribution flow [Tidy] Remove pip as dependency and fully switch to uv Sep 24, 2024
Copy link
Contributor

@huong-li-nguyen huong-li-nguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@antonymilne antonymilne merged commit 1f42a1b into main Sep 25, 2024
41 checks passed
@antonymilne antonymilne deleted the tidy/contribution-flow branch September 25, 2024 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Vizro-AI 🤖 Issue/PR that addresses Vizro-AI package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants