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

Migrate from setuptools to hatch #150

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open

Conversation

M4a1x
Copy link

@M4a1x M4a1x commented Feb 9, 2023

As suggested in #149 this removes setup.py/setup.cfg and replaces it with hatch, configured in the pyproject.toml. I took inspiration from the hatch projects' pypoetry.toml for this.

The metadata was directly converted with some more keywords and classifiers added. The version number moved to __about__.py. I also added a custom build hook to compile the resources.qrc as was done in the setup.py. It's my first time writing a hatch hook, so if you spot something feel free to point it out.

I already added black, pytest, ... as environment/development dependencies as well as some basic configuration. The windows-binary.yml workflow still works as well.

Basic usage of hatch looks like this (with hatch installed e.g. through pip install hatch or package manager):

# Run program/script (also sets up virtual environment and builds artifacts)
hatch run rmview

# Setup environment in `.venv` folder
hatch env create

# Build distribution
hatch build

# Activate python environment
hatch shell

@bordaigorl
Copy link
Owner

Is this ready for review or are you planning to add more to it?

@M4a1x
Copy link
Author

M4a1x commented Feb 23, 2023

I'd appreciate it if you could have a look. To keep things simple I thought I'd start off by only switching to hatch at first and then doing the other things from #149 I proposed.

I don't have much experience contributing to projects on Github, so If I should e.g. just put all the changes in consecutive commits on this request or so - please, feel free to instruct me 😅

This was linked to issues Feb 24, 2023
@bordaigorl bordaigorl changed the base branch from vnc to devel March 2, 2023 10:14
@bordaigorl
Copy link
Owner

I have tried to use hatch but something is not working.
I don't understand how this works so I might just be doing something stupid.
I installed hatch, then run hatch run rmview which started building the environment and complained about a bunch of dependencies. I (re?)installed the dependencies manually and those errors were replaced by a runtime exception triggered by twisted in relation to OpenSSL. Needless to say, rmview works if run on the vnc branch.

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.

Update tooling Use Black to format the code
2 participants