-
Notifications
You must be signed in to change notification settings - Fork 51
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
[FEATURE] Migrate Apps from setup.py to pyproject.toml #999
Comments
It looks like the latest version of from tethys_apps.app_installation import find_all_resource_files × Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
Traceback (most recent call last):
File "/Users/rditlsc9/conda/envs/tethys-install/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
~~~~^^
File "/Users/rditlsc9/conda/envs/tethys-install/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/rditlsc9/conda/envs/tethys-install/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/private/var/folders/57/2pp3zbc93qd62k1qw1pmq9tcmw_trg/T/pip-build-env-xgtfiz_g/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/57/2pp3zbc93qd62k1qw1pmq9tcmw_trg/T/pip-build-env-xgtfiz_g/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
self.run_setup()
~~~~~~~~~~~~~~^^
File "/private/var/folders/57/2pp3zbc93qd62k1qw1pmq9tcmw_trg/T/pip-build-env-xgtfiz_g/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 522, in run_setup
super().run_setup(setup_script=setup_script)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/57/2pp3zbc93qd62k1qw1pmq9tcmw_trg/T/pip-build-env-xgtfiz_g/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup
exec(code, locals())
~~~~^^^^^^^^^^^^^^^^
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'tethys_apps'
[end of output] |
There are two possible solutions. One is that we make The other is that we just add the It could look something like this:
from pathlib import Path
from setuptools import setup, find_namespace_packages
def find_all_resource_files(app_package, app_root):
relative_to = Path(f"{app_root}/{app_package}")
resources = []
for resource_type in ('templates', 'public', 'workspaces'):
for path, __, filenames in (relative_to / resource_type).walk():
resources.extend([str(Path(path).relative_to(relative_to) / filename) for filename in filenames])
return resources
# -- Apps Definition -- #
app_package = 'my_app'
package_namespace = 'tethysapp'
release_package = f'{package_namespace}-{app_package}'
# -- Python Dependencies -- #
dependencies = []
# -- Get Resource File -- #
resource_files = find_all_resource_files(
app_package, package_namespace
)
setup(
name=release_package,
packages=find_namespace_packages(),
package_data={'': resource_files},
)
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[package]
version = '0.0.1'
description = ''
long_description = ''
keywords = ''
author = ''
author_email = ''
url = ''
license = ''
include_package_data = true
zip_safe = false
install_requires = []
|
We wither need to fix this for 4.3 or pin |
Is your feature request related to a problem? Please describe.
The setup.py is being phased out in favor of the more standardized pyproject.toml.
Describe the solution you'd like
We should migrate apps to pyproject.toml. The
tethys install
command is already compatible pyproject.toml (it usespip install -e .
instead ofsetup.py develop
).Describe alternatives you've considered
N/A - pyproject.toml is the standard recommended build configuration file for Python modules.
Additional context
The text was updated successfully, but these errors were encountered: