Skip to content
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 Request] Package ubuntu-server-netboot as a python package #18

Open
tai271828 opened this issue May 5, 2021 · 3 comments
Open

Comments

@tai271828
Copy link
Collaborator

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 #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.

@tai271828
Copy link
Collaborator Author

tai271828 commented May 11, 2021

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/ usn in 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.

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:~$ 

@dannf
Copy link
Owner

dannf commented May 11, 2021

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/ usn in 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 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]

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:~$ 

@tai271828
Copy link
Collaborator Author

tai271828 commented May 12, 2021

@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.

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/ usn in 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 #21 .

tai271828 added a commit to tai271828/ubuntu-server-netboot that referenced this issue May 17, 2021
tai271828 added a commit to tai271828/ubuntu-server-netboot that referenced this issue May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants