Skip to content

Commit

Permalink
Update python packaging files and prepare to release an alpha (#35)
Browse files Browse the repository at this point in the history
LICENSE -> LICENSE.txt:
	- Renamed due to recommendation of PyPA

	RPi/GPIO/__init__.py:
	- Update VERSION2 constant to python package release number

	setup.cfg:
	- Create file as per recommendation of PyPA

	setup.py:
	- Update version number to match GitHub scheme
	- Update classifiers
	- Add project URLs (Source, Bug Reports)

	tests/test_gpio.py:
	- Add test for canonical python verison number
	  using our new RPi.GPIO.VERSION2 constant

Signed-off-by: Joel Savitz <joelsavitz@gmail.com>
  • Loading branch information
theyoyojo authored Jun 19, 2020
1 parent f902444 commit 21cf82c
Show file tree
Hide file tree
Showing 8 changed files with 724 additions and 26 deletions.
12 changes: 0 additions & 12 deletions LICENSE

This file was deleted.

674 changes: 674 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions RPi/GPIO/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@
setup,\
setwarnings,\
wait_for_edge

# python3-libgpiod-rpi base version
VERSION2 = "0.3.0a1" # Leviticus Alpha
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
license_files = LICENSE.txt
45 changes: 33 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
import setuptools
from setuptools import setup, find_packages

with open("README.md", "r") as fh:
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

setuptools.setup(
name="RPi.GPIO",
version="0.0.2",
author="Underground Software",
author_email="fedora-rpi@googlegroups.com",
setup(
name="RPi.GPIO2",
version="0.3.0a1",

author="Joel Savitz",
author_email="joelsavitz@gmail.com",

description="Compatibility layer between RPi.GPIO syntax and libgpiod semantics",
long_description=long_description,
long_description_content_type="text/markdown",

url="https://github.com/underground-software/python3-libgpiod-rpi",
packages=setuptools.find_packages(),
packages=find_packages(),

classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: POSIX :: Linux",
"Intended Audience :: Education",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Development Status :: 2 - Pre-Alpha"
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"
"Operating System :: POSIX :: Linux"
"Programming Language :: Python :: 3.7",
"Topic :: Home Automation",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: System :: Hardware",
],
python_requires='>=3.6',

keywords="Raspberry Pi GPIO libgpiod RPi.GPIO",

python_requires=">=3.7",

project_urls={
"Source": "https://github.com/underground-software/python3-libgpiod-rpi",
"Bug Reports": "https://github.com/underground-software/python3-libgpiod-rpi/issues",
},
)
4 changes: 2 additions & 2 deletions spec/spec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ \subsection{Definitions and Acronyms}
GPIO channel or pin &
\begin{tabular}[c]{@{}l@{}}
The number that maps to some GPIO line \\
in terms of either of BCM or BOARD
in terms of either of BCM or BOARD pin numbering modes
\end{tabular} \\ \hline
GPIO line &
\begin{tabular}[c]{@{}l@{}}
Expand Down Expand Up @@ -275,7 +275,7 @@ \subsection{Core \texttt{RPi.GPIO} API} \label{coreapi}
\end{itemize}


\noindent \texttt{RPi.GPIO}.\textbf{output}(channel)
\noindent \texttt{RPi.GPIO}.\textbf{output}(channel, value)

Set the value of an individual GPIO channel or a list/tuple of GPIO channels with an individual value or a list/tuple of values respectively.
One may specify multiple channels and a single value for each channel to be set to the same value.
Expand Down
2 changes: 2 additions & 0 deletions test-style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ do
scan examples/"$f"
fi
done

scan setup.py
8 changes: 8 additions & 0 deletions tests/test_gpio.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,3 +549,11 @@ def test_cleanup():
GPIO.cleanup((18, 21))

GPIO_DEVEL.Reset()


def test_version_compliance():
# Source: https://www.python.org/dev/peps/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions

_re = r'^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$'

assert re.match(_re, GPIO.VERSION2) is not None

0 comments on commit 21cf82c

Please sign in to comment.