| ... | ... |
@@ -5,6 +5,68 @@ Parse [Raspberry Pi revision codes][]. |
| 5 | 5 |
[`raspi-revcode`]: https://git.rcrnstn.net/rcrnstn/raspi-revcode |
| 6 | 6 |
[Raspberry Pi revision codes]: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-revision-codes |
| 7 | 7 |
|
| 8 |
+## Install |
|
| 9 |
+ |
|
| 10 |
+Make sure [Python is installed][Python download], [`pip`][] is available and |
|
| 11 |
+the [`pip`][], [`setuptools`][] and [`wheel`][] packages are up to date: |
|
| 12 |
+ |
|
| 13 |
+```sh |
|
| 14 |
+python3 -m pip install --user --upgrade pip setuptools wheel |
|
| 15 |
+``` |
|
| 16 |
+ |
|
| 17 |
+Reference: [Python Packaging User Guide: Requirements for Installing |
|
| 18 |
+Packages][]. |
|
| 19 |
+ |
|
| 20 |
+[Python download]: https://python.org/download |
|
| 21 |
+[`pip`]: https://pip.readthedocs.io |
|
| 22 |
+[`setuptools`]: https://setuptools.readthedocs.io |
|
| 23 |
+[`wheel`]: https://wheel.readthedocs.io |
|
| 24 |
+[Python Packaging User Guide: Requirements for Installing Packages]: https://packaging.python.org/tutorials/installing-packages/#requirements-for-installing-packages |
|
| 25 |
+ |
|
| 26 |
+### With [`pipx`][], for users |
|
| 27 |
+ |
|
| 28 |
+Make sure [`pipx`][] is installed: |
|
| 29 |
+ |
|
| 30 |
+```sh |
|
| 31 |
+python3 -m pip install --user pipx |
|
| 32 |
+``` |
|
| 33 |
+ |
|
| 34 |
+Install `raspi-revcode`: |
|
| 35 |
+ |
|
| 36 |
+```sh |
|
| 37 |
+pipx install "git+https://git.rcrnstn.net/rcrnstn/raspi-revcode" |
|
| 38 |
+``` |
|
| 39 |
+ |
|
| 40 |
+`raspi-revcode` should now be in your [`PATH`][] (if not, run `python3 -m pipx |
|
| 41 |
+ensurepath`). |
|
| 42 |
+ |
|
| 43 |
+Reference: [Python Packaging User Guide: Installing stand alone command line |
|
| 44 |
+tools][]. |
|
| 45 |
+ |
|
| 46 |
+[`pipx`]: https://pipxproject.github.io/pipx/ |
|
| 47 |
+[`PATH`]: https://en.wikipedia.org/wiki/PATH_(variable) |
|
| 48 |
+[Python Packaging User Guide: Installing stand alone command line tools]: https://packaging.python.org/guides/installing-stand-alone-command-line-tools/ |
|
| 49 |
+ |
|
| 50 |
+### Into [`venv`][], for developers |
|
| 51 |
+ |
|
| 52 |
+Clone and install into a repository [`venv`][] virtual environment: |
|
| 53 |
+ |
|
| 54 |
+```sh |
|
| 55 |
+git clone "https://git.rcrnstn.net/rcrnstn/raspi-revcode" |
|
| 56 |
+cd "raspi-revcode" |
|
| 57 |
+python3 -m venv .venv |
|
| 58 |
+. .venv/bin/activate |
|
| 59 |
+python3 -m pip install --editable . |
|
| 60 |
+``` |
|
| 61 |
+ |
|
| 62 |
+`raspi-revcode` should now be in your (virtual environment) [`PATH`][]. |
|
| 63 |
+ |
|
| 64 |
+Reference: [Python Packaging User Guide: Installing packages using pip and |
|
| 65 |
+virtual environments][]. |
|
| 66 |
+ |
|
| 67 |
+[`venv`]: https://docs.python.org/3/library/venv.html |
|
| 68 |
+[Python Packaging User Guide: Installing packages using pip and virtual environments]: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/ |
|
| 69 |
+ |
|
| 8 | 70 |
## License |
| 9 | 71 |
|
| 10 | 72 |
Licensed under the [ISC License][] unless otherwise noted, see the |
| 11 | 73 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,29 @@ |
| 1 |
+from setuptools import setup |
|
| 2 |
+ |
|
| 3 |
+with open("README.md") as f:
|
|
| 4 |
+ long_description = f.read() |
|
| 5 |
+ |
|
| 6 |
+setup( |
|
| 7 |
+ name='raspi-revcode', |
|
| 8 |
+ version='1.0.0', |
|
| 9 |
+ description=""" |
|
| 10 |
+ Parse Raspberry Pi revision codes. |
|
| 11 |
+ """, |
|
| 12 |
+ long_description=long_description, |
|
| 13 |
+ long_description_content_type='text/markdown', |
|
| 14 |
+ url='https://git.rcrnstn.net/rcrnstn/raspi-revcode', |
|
| 15 |
+ author="Robert Cranston", |
|
| 16 |
+ classifiers=[ |
|
| 17 |
+ 'Programming Language :: Python :: 3', |
|
| 18 |
+ 'License :: OSI Approved :: ISC License (ISCL)', |
|
| 19 |
+ ], |
|
| 20 |
+ python_requires='>=3, <4', |
|
| 21 |
+ install_requires=[ |
|
| 22 |
+ ], |
|
| 23 |
+ py_modules=['raspi_revcode'], |
|
| 24 |
+ entry_points={
|
|
| 25 |
+ 'console_scripts': [ |
|
| 26 |
+ 'raspi-revcode = raspi_revcode:main', |
|
| 27 |
+ ], |
|
| 28 |
+ }, |
|
| 29 |
+) |