mdklatt / httpexec

Execute CLI commands over HTTP via a REST API.
MIT License
0 stars 0 forks source link

Replace setup.py with pyproject.toml #2

Closed mdklatt closed 1 year ago

mdklatt commented 1 year ago

The use of setup.py is deprecated, and this should be replaced with a pyproject.toml file. See serial-core v0.9.0 as an example.

mdklatt commented 1 year ago

The data_files directive in setup.py is deprecated in Setuptools, and there is no comparable alternative. The recommended solution is to use package data. However this places everything inside the installed Python package (i.e. down in site-packages), which is not suitable for user-facing editable assets like config files.

It looks like Poetry isn't a viable alternative because it takes the same approach.

mdklatt commented 1 year ago

Stuck between a rock and hard place now. It looks like data_files functionality is dead, or at least as it's used here. In the meantime, setup.py installs seem to be broken for good on Python 3.11, even when pinning pip and setuptools to versions that work with Python 3.10.

mdklatt commented 1 year ago

This project can provide a default config file within the package data, and then it's up to the user to provide a different config file and appropriate value for $HTTP_CONFIG_PATH if desired.

mdklatt commented 1 year ago

The Basics of Python Packaging in Early 2023

There are lots of different options for build backends and frontends, but for now stick with setuptools and pip.

mdklatt commented 1 year ago

For this project, the config file is very simple. It would be easy to forego a packaged file altogether and hardcode the defaults in the code. Or, package a defaults file that looks like a config file but will be overwritten bye user-supplied values.

mdklatt commented 1 year ago

Issue resolved by commit 36e3cfb7d8eea9ea7c5dcc8b052f4dc5d6cf24e0.