-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
522 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: pre-commit | ||
|
||
on: | ||
push: | ||
branches: ["**"] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8" | ||
cache: "pip" | ||
- run: pip install -r crispy-api/requirements-dev.txt | ||
- uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
|
||
on: | ||
push: | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
build-n-publish: | ||
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8" | ||
- name: Install pypa/build | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: >- | ||
python -m | ||
build | ||
--sdist | ||
--wheel | ||
--outdir dist/ | ||
. | ||
- name: Publish distribution 📦 to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository-url: https://test.pypi.org/legacy/ | ||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Pytest | ||
|
||
on: | ||
push: | ||
branches: ["**"] | ||
pull_request: | ||
branches: [master] | ||
|
||
defaults: | ||
run: | ||
working-directory: src | ||
|
||
jobs: | ||
pytest: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
- run: pip install -r requirements-dev.txt | ||
- run: pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.3.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
stages: [commit] | ||
- repo: https://github.com/psf/black | ||
rev: 22.10.0 | ||
hooks: | ||
- id: black | ||
require_serial: true | ||
name: Coding style (Black) | ||
language_version: python3.8 | ||
stages: [commit] | ||
exclude: ^legacy-backend.*$ | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
require_serial: true | ||
name: isort | ||
args: ["--profile", "black"] | ||
stages: [commit] | ||
exclude: ^legacy-backend.*$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
# PY-ACR122U | ||
|
||
<img src="http://downloads.acs.com.hk/product-website-image/acr38-image.jpg" width="150" height="150"> | ||
[![PyPI - Version](https://img.shields.io/pypi/v/py122u)](https://pypi.org/project/py122u/) | ||
[![PyPI - License](https://img.shields.io/pypi/l/py122u)](https://pypi.org/project/py122u/) | ||
[![PyPI - Downloads](https://img.shields.io/pypi/dm/py122u)](https://pypi.org/project/py122u/) | ||
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/py122u)](https://pypi.org/project/py122u/) | ||
[![PyPI - Wheel](https://img.shields.io/pypi/wheel/py122u)](https://pypi.org/project/py122u/) | ||
|
||
This is a python library for the ACR122U NFC reader | ||
|
||
## Installation | ||
- git clone https://github.com/Flowtter/py-acr122u.git | ||
- cd py-acr122u | ||
- pip install -r requirements.txt | ||
|
||
```shell | ||
pip install py122u | ||
``` | ||
|
||
## Usage | ||
|
||
```python | ||
from src import nfc | ||
|
||
from py122u import nfc | ||
|
||
reader = nfc.Reader() | ||
reader.connect() | ||
reader.print_data(reader.get_uid()) | ||
reader.info() | ||
``` | ||
- python main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
[build-system] | ||
requires = ["setuptools>=61.0.0", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "py122u" | ||
version = "2.3.1" | ||
description = "This is a python library for the ACR122U NFC reader" | ||
readme = "README.md" | ||
authors = [{ name = "Brice PARENT", email = "[email protected]"}, { name = "Robert van Dijk", email = "[email protected]" }] | ||
license = { file = "LICENSE" } | ||
classifiers = [ | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
] | ||
keywords = ["nfc", "acr", "acr122u"] | ||
dependencies = [ | ||
"pyscard>=2.0.7", | ||
] | ||
requires-python = ">=3.8" | ||
|
||
[project.optional-dependencies] | ||
dev = ["black", "bumpver", "isort", "pip-tools", "pytest", "pytest-mock"] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/Flowtter/py-acr122u" | ||
|
||
[tool.bumpver] | ||
current_version = "2.3.1" | ||
version_pattern = "MAJOR.MINOR.PATCH" | ||
commit_message = "Bump version {old_version} -> {new_version}" | ||
commit = true | ||
tag = true | ||
push = false | ||
|
||
[tool.bumpver.file_patterns] | ||
"pyproject.toml" = [ | ||
'current_version = "{version}"', | ||
'version = "{version}"', | ||
] | ||
"src/py122u/__init__.py" = ["{version}"] | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
addopts = "-ra -q" | ||
testpaths = [ | ||
"tests", | ||
"integration", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[pytest] | ||
testpaths = tests | ||
python_files = *.py | ||
addopts = -vv --showlocals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-r requirements.txt | ||
black | ||
isort | ||
pytest | ||
pytest-mock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
pyscard | ||
pyscard |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "2.3.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.