Browse code

Add installation

Robert Cranston authored on 29/10/2023 05:19:28
Showing 3 changed files

1 1
new file mode 100644
... ...
@@ -0,0 +1,3 @@
1
+/.venv
2
+/__pycache__
3
+/*.egg-info
... ...
@@ -5,6 +5,70 @@ 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
+### Prerequisites
11
+
12
+Make sure [Python is installed][Python download], [`pip`][] is available and
13
+the [`pip`][], [`setuptools`][] and [`wheel`][] packages are up to date:
14
+
15
+```sh
16
+python3 -m pip install --user --upgrade pip setuptools wheel
17
+```
18
+
19
+Reference: [Python Packaging User Guide: Requirements for Installing
20
+Packages][].
21
+
22
+[Python download]: https://python.org/download
23
+[`pip`]: https://pip.readthedocs.io
24
+[`setuptools`]: https://setuptools.readthedocs.io
25
+[`wheel`]: https://wheel.readthedocs.io
26
+[Python Packaging User Guide: Requirements for Installing Packages]: https://packaging.python.org/tutorials/installing-packages/#requirements-for-installing-packages
27
+
28
+### With [`pipx`][], for users
29
+
30
+Make sure [`pipx`][] is installed:
31
+
32
+```sh
33
+python3 -m pip install --user pipx
34
+```
35
+
36
+Install `raspi-revcode`:
37
+
38
+```sh
39
+pipx install "git+https://git.rcrnstn.net/rcrnstn/raspi-revcode"
40
+```
41
+
42
+`raspi-revcode` should now be in your [`PATH`][] (if not, run `python3 -m pipx
43
+ensurepath`).
44
+
45
+Reference: [Python Packaging User Guide: Installing stand alone command line
46
+tools][].
47
+
48
+[`pipx`]: https://pipxproject.github.io/pipx/
49
+[`PATH`]: https://en.wikipedia.org/wiki/PATH_(variable)
50
+[Python Packaging User Guide: Installing stand alone command line tools]: https://packaging.python.org/guides/installing-stand-alone-command-line-tools/
51
+
52
+### Into [`venv`][], for developers
53
+
54
+Clone and install into a repository [`venv`][] virtual environment:
55
+
56
+```sh
57
+git clone "https://git.rcrnstn.net/rcrnstn/raspi-revcode"
58
+cd "raspi-revcode"
59
+python3 -m venv .venv
60
+. .venv/bin/activate
61
+python3 -m pip install --editable .
62
+```
63
+
64
+`raspi-revcode` should now be in your (virtual environment) [`PATH`][].
65
+
66
+Reference: [Python Packaging User Guide: Installing packages using pip and
67
+virtual environments][].
68
+
69
+[`venv`]: https://docs.python.org/3/library/venv.html
70
+[Python Packaging User Guide: Installing packages using pip and virtual environments]: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
71
+
8 72
 ## License
9 73
 
10 74
 Licensed under the [ISC License][] unless otherwise noted, see the
11 75
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
+)