PyThermostat: Add entry points to runnable scripts #149

Merged
sb10q merged 2 commits from atse/thermostat:pytec-entry-points into master 2024-11-25 10:56:45 +08:00
Contributor

For easier access to the runnable Python scripts for the Thermostat.

For easier access to the runnable Python scripts for the Thermostat.
atse added 1 commit 2024-11-11 17:16:15 +08:00
For easier access to `plot.py` and `autotune.py` scripts.
Author
Contributor

Note: In plot.py, a main function didn't exist, so I've simply moved the script contents into one.

Note: In `plot.py`, a main function didn't exist, so I've simply moved the script contents into one.
esavkin reviewed 2024-11-12 10:36:52 +08:00
pytec/setup.py Outdated
@ -9,4 +9,11 @@ setup(
license="GPLv3",
install_requires=["setuptools"],
packages=find_packages(),
entry_points={
Owner

Maybe silly question, but how can I reproduce it and what result is expected?

Maybe silly question, but how can I reproduce it and what result is expected?
Author
Contributor

You can do pip install pytec/, and the entry points would be available in the shell as commands.

You can do `pip install pytec/`, and the entry points would be available in the shell as commands.
atse marked this conversation as resolved
sb10q reviewed 2024-11-16 13:14:34 +08:00
pytec/setup.py Outdated
@ -12,0 +12,4 @@
entry_points={
"gui_scripts": [
"autotune = autotune:main",
"plot = plot:main",
Owner

This just creates "autotune" and "plot" Unix commands when installed. Not specific enough and may easily conflict with other programs, you should e.g. add some prefix.

This just creates "autotune" and "plot" Unix commands when installed. Not specific enough and may easily conflict with other programs, you should e.g. add some prefix.
Author
Contributor

Added the "thermostat_" prefix to the entry points in the force-push to 1fc5f7d5ae.

Added the "thermostat_" prefix to the entry points in the force-push to 1fc5f7d5ae.
atse marked this conversation as resolved
atse force-pushed pytec-entry-points from 54296c88b4 to 1fc5f7d5ae 2024-11-18 11:48:57 +08:00 Compare
sb10q reviewed 2024-11-18 14:05:11 +08:00
pytec/setup.py Outdated
@ -12,0 +15,4 @@
"thermostat_plot = plot:main",
]
},
py_modules=["autotune", "plot"],
Owner

Isn't there a similar problem here, creating Python modules with nonspecific names "autotune" and "plot"?
Shoudln't they just all be under a "pytec" module?
Also calling it "pytec" is a misnomer, everything else is named around "thermostat" and additionally the device can be used with resistive heaters instead of TECs.

Isn't there a similar problem here, creating Python modules with nonspecific names "autotune" and "plot"? Shoudln't they just all be under a "pytec" module? Also calling it "pytec" is a misnomer, everything else is named around "thermostat" and additionally the device can be used with resistive heaters instead of TECs.
Author
Contributor

Shoudln't they just all be under a "pytec" module?

Ok, I'll file them further in the directory tree.

Also calling it "pytec" is a misnomer, everything else is named around "thermostat" and additionally the device can be used with resistive heaters instead of TECs.

Yes! I was wondering why this naming was like this in the first place. What's worse is that it looks like two completely unrelated pytec packages coexist already too, with one of them being on PyPI...

> Shoudln't they just all be under a "pytec" module? Ok, I'll file them further in the directory tree. > Also calling it "pytec" is a misnomer, everything else is named around "thermostat" and additionally the device can be used with resistive heaters instead of TECs. Yes! I was wondering why this naming was like this in the first place. What's worse is that it looks like [two](https://github.com/sylvathle/pytec) [completely](https://pypi.org/project/pytec/) unrelated `pytec` packages coexist already too, with one of them being on PyPI...
Author
Contributor

I moved the scripts one-level in with #155, and renamed Pytec to PyThermostat in #156.

I moved the scripts one-level in with https://git.m-labs.hk/M-Labs/thermostat/pulls/155, and renamed Pytec to PyThermostat in https://git.m-labs.hk/M-Labs/thermostat/pulls/156.
Author
Contributor

Those non-specific Python modules are now under the PyThermostat module with #155.

Those non-specific Python modules are now under the PyThermostat module with #155.
atse marked this conversation as resolved
atse force-pushed pytec-entry-points from 1fc5f7d5ae to ee094241bb 2024-11-18 17:56:03 +08:00 Compare
atse changed title from pytec: Set `autotune` and `plot` as entry points to PyThermostat: Add entry points to runnable scripts 2024-11-18 17:56:27 +08:00
sb10q reviewed 2024-11-18 19:26:16 +08:00
@ -12,0 +18,4 @@
"thermostat_test = test:main",
]
},
py_modules=["autotune", "plot", "test"],
Owner

Looks suspicious to me that ARTIQ also has several entry points but does not use py_modules and the entry points are prefixed with artiq..

Looks suspicious to me that ARTIQ also has several entry points but does not use ``py_modules`` and the entry points are prefixed with ``artiq.``.
Author
Contributor

Fixed, no need for py_modules now but depends on #155.

Fixed, no need for `py_modules` now but depends on #155.
atse marked this conversation as resolved
atse force-pushed pytec-entry-points from ee094241bb to 36d80ebdff 2024-11-25 10:10:29 +08:00 Compare
sb10q merged commit 36d80ebdff into master 2024-11-25 10:56:45 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/thermostat#149
No description provided.