Feature Description
Currently, ifcPatch CLI can only be run via python -m ifcpatch.
The current instructions to use an alias may work, but its doesn't play well with multiple environments, especially now that we have easy to use isolated environment managers such as pipx and uv.
Using the wonderful uv as an example, to run ifcpatch in an ephemeral environment, one needs to:
uvx --with ifcpatch python -m ifcpatch ...
instead of just uvx ifcpatch ... as one would expect.
$ uvx ifcpatch -h
The executable `ifcpatch` was not found.
warning: Package `ifcpatch` does not provide any executables.
this also makes it impossible to install ifcpatch with uv tool install which errors out with the No executables are provided by ifcpatch message.
Python already has all we need to create a proper cross platform executable via the project.scripts table
since this config needs a function, it cannot points to the __main__ module directly, unless we wrap everything inside it in a main function
def main():
# current contents of __main__.py
if __name__ == "__main__":
main()
and then use it in the pyproject.toml
[project.scripts]
ifcpatch = "ifcpatch.__main__:main"
to be more explicit, the main function could be named cli and put into a cli module.
Feature Description
Currently, ifcPatch CLI can only be run via
python -m ifcpatch.The current instructions to use an alias may work, but its doesn't play well with multiple environments, especially now that we have easy to use isolated environment managers such as pipx and uv.
Using the wonderful uv as an example, to run ifcpatch in an ephemeral environment, one needs to:
instead of just
uvx ifcpatch ...as one would expect.this also makes it impossible to install ifcpatch with
uv tool installwhich errors out with theNo executables are provided by ifcpatchmessage.Python already has all we need to create a proper cross platform executable via the
project.scriptstablesince this config needs a function, it cannot points to the
__main__module directly, unless we wrap everything inside it in amainfunctionand then use it in the pyproject.toml
to be more explicit, the
mainfunction could be namedcliand put into aclimodule.