fellerts / procal

Simple Qt-based programming calculator
GNU General Public License v3.0
167 stars 8 forks source link

Add pyproject.toml to allow packaging of procal #9

Closed joajfreitas closed 1 year ago

joajfreitas commented 1 year ago

Currently there is not way to install procal. This PR adds a pyproject.toml configuration that setuptools can use to install procal.

fellerts commented 1 year ago

Thanks, I agree that there should be some way to install this. I'm not familiar with pyproject.toml files though, and I'm having trouble making your suggestion work:

$ cd /tmp && git clone https://github.com/joajfreitas/procal.git
$ python3 -m venv venv && source venv/bin/activate
$ pip install --upgrade pip
[ snip ]
Successfully installed pip-23.0.1
(venv) $ pip install .
[ snip; pip installs stuff ]
(venv) $ procal
Traceback (most recent call last):
  File "/tmp/procal/venv/bin/procal", line 5, in <module>
    from procal import main
ModuleNotFoundError: No module named 'procal'

Everything looks ok to me though:

(venv) $ pip freeze | grep procal
procal @ file:///tmp/procal
(venv) $ python -c "from procal import main; main()"
# procal launches...

Does this work for you? I'm on Ubuntu 20.04 at the moment.

joajfreitas commented 1 year ago

You are correct. I did the setup.py version first and then must not have tested the pyproject.toml version properly.

I was also not familiar with pyproject.toml.

I've updated it so that now it should work. Unfortunatelly wasn't able to make it so that the single procal.py file was kept and had to add a package.

fellerts commented 1 year ago

Sorry for the late response @joajfreitas, finally had a chance to test this now. Seems to work well! I'll merge this.