ubuntu-server-netboot
ubuntu-server-netboot copied to clipboard
[Feature Request] Package ubuntu-server-netboot as a python package
Description
Per our discussion on MM, we will package the tool as a python package so we could implement canonical unit-test sets for the tool more easily.
Possible Solution
With package management tool poetry, for example https://github.com/tai271828/ubuntu-server-netboot/tree/pr-poetry-python-package on top of https://github.com/dannf/ubuntu-server-netboot/pull/17
Additional Information
When the tool is ready to be a python package, we could begin to consider package and distribute it as a (python) debian package as well.
A testing python package has been uploaded to testing PyPI https://test.pypi.org/project/usn/ .
@dannf you may want to have a look of the package page on testing PyPI https://test.pypi.org/project/usn/ to see what else information you want to add or update. For example, some items pop up in my mind:
- the python package name: should it be
usn,ubuntu-server-netboot, or ...?- the name will be used when invoking pip installation, for example, to install this test package from testing PyPI currently by
pip install -i https://test.pypi.org/simple/ usnin a python virtual environment
- the name will be used when invoking pip installation, for example, to install this test package from testing PyPI currently by
- project description is empty. I will use the current README later on.
- I may also need your account user name on PyPI if you have, so I can add you in the list of project admin of the package.
Please note we need to use pip3 in a vanilla Ubuntu environment instead to install the package pip3 install -i https://test.pypi.org/simple/ usn and an extra PATH setup command to activate the cli.[1]
[1]
ubuntu@awrep6:~$ pip3 install -i https://test.pypi.org/simple/ usn
Looking in indexes: https://test.pypi.org/simple/
Collecting usn
Downloading https://test-files.pythonhosted.org/packages/2d/b5/a16f3d1bbf8290f834c9a20fefe28553c398e871e1631c2a65ccfe749092/usn-0.1.0-py3-none-any.whl (6.7 kB)
Installing collected packages: usn
WARNING: The script ubuntu-server-netboot is installed in '/home/ubuntu/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed usn-0.1.0
ubuntu@awrep6:~$ export PATH=$PATH:/home/ubuntu/.local/bin
ubuntu@awrep6:~$ ubuntu-server-netboot
usage: ubuntu-server-netboot [-h] [-e EXTRA_ARGS] [--iso ISO] [-o OUT_DIR] --url URL [--autoinstall-url AUTOINSTALL_URL]
ubuntu-server-netboot: error: the following arguments are required: --url
ubuntu@awrep6:~$
A testing python package has been uploaded to testing PyPI https://test.pypi.org/project/usn/ .
Awesome!
@dannf you may want to have a look of the package page on testing PyPI https://test.pypi.org/project/usn/ to see what else information you want to add or update. For example, some items pop up in my mind:
- the python package name: should it be
usn,ubuntu-server-netboot, or ...?
Personally I'd vote for ubuntu-server-netboot, but I'm not picky if there's a reason to use usn.
- the name will be used when invoking pip installation, for example, to install this test package from testing PyPI currently by
pip install -i https://test.pypi.org/simple/ usnin a python virtual environment- project description is empty. I will use the current README later on.
- I may also need your account user name on PyPI if you have, so I can add you in the list of project admin of the package.
I've just now created the account dannf
Please note we need to use
pip3in a vanilla Ubuntu environment instead to install the packagepip3 install -i https://test.pypi.org/simple/ usnand an extra PATH setup command to activate the cli.[1]
ACK. Thanks!
[1]
ubuntu@awrep6:~$ pip3 install -i https://test.pypi.org/simple/ usn Looking in indexes: https://test.pypi.org/simple/ Collecting usn Downloading https://test-files.pythonhosted.org/packages/2d/b5/a16f3d1bbf8290f834c9a20fefe28553c398e871e1631c2a65ccfe749092/usn-0.1.0-py3-none-any.whl (6.7 kB) Installing collected packages: usn WARNING: The script ubuntu-server-netboot is installed in '/home/ubuntu/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed usn-0.1.0 ubuntu@awrep6:~$ export PATH=$PATH:/home/ubuntu/.local/bin ubuntu@awrep6:~$ ubuntu-server-netboot usage: ubuntu-server-netboot [-h] [-e EXTRA_ARGS] [--iso ISO] [-o OUT_DIR] --url URL [--autoinstall-url AUTOINSTALL_URL] ubuntu-server-netboot: error: the following arguments are required: --url ubuntu@awrep6:~$
@dannf you may want to have a look of the package page on testing PyPI https://test.pypi.org/project/usn/ to see what else information you want to add or update. For example, some items pop up in my mind:
- the python package name: should it be
usn,ubuntu-server-netboot, or ...?Personally I'd vote for
ubuntu-server-netboot, but I'm not picky if there's a reason to useusn.
ubuntu-server-netboot is good to me. No, there is no reason to use usn. The name usn is automatically generated by poetry by default. We are free to change it anytime we want.
- the name will be used when invoking pip installation, for example, to install this test package from testing PyPI currently by
pip install -i https://test.pypi.org/simple/ usnin a python virtual environment- project description is empty. I will use the current README later on.
- I may also need your account user name on PyPI if you have, so I can add you in the list of project admin of the package.
I've just now created the account
dannf
ACK. I will loop you into the admin group after the package is released to the production PyPI. I will create another PR to polish the look of PyPI page and re-upload again after this pull request is completed https://github.com/dannf/ubuntu-server-netboot/pull/21 .