Skip to content

Commit

Permalink
Converting from Gitlab repository
Browse files Browse the repository at this point in the history
  • Loading branch information
casabre committed Mar 9, 2022
1 parent e8a8cbc commit f99470b
Show file tree
Hide file tree
Showing 28 changed files with 1,037 additions and 581 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
52 changes: 52 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Tests

on:
pull_request:
push:
branches:
- "main"

jobs:
test-python:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python:
[
"3.6",
"3.7",
"3.8",
"3.9",
"3.10",
"pypy-3.6",
"pypy-3.7",
"pypy-3.8",
"pypy-3.9",
]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Analysing the code with mypy
continue-on-error: true
run: |
tox -e types
- name: Analysing the code with pylint/flake
continue-on-error: true
run: |
tox -e errors
- name: Run pytests with coverage
run: |
tox -e test -- --junitxml=results.xml tests/
- name: Convert coverage
run: |
tox -e coverage
141 changes: 128 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,142 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

.idea/
# C extensions
*.so

venv/
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

pysomq/__pycache__/
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

tests/__pycache__/
# Installer logs
pip-log.txt
pip-delete-this-directory.txt

.eggs/
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

pysomq/pysomq.egg-info/
# Translations
*.mo
*.pot

pysomq/_version.py
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

dist/
# Flask stuff:
instance/
.webassets-cache

build/
*.pyc
# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

pysomq/__init__.pyc
# pyenv
.python-version

.mypy_cache
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

tests/__init__.pyc
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
.*venv/
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Temporary version file
_version.py

# IDE
.vscode/
.idea/

# Tox result files
flake.json
pylint.json
results.xml
45 changes: 0 additions & 45 deletions .gitlab-ci.yml

This file was deleted.

21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ This package utilizes the Python bindings of [ØMQ](http://www.zeromq.org) in or

## Getting started

Install the package from Pypi

```bash
pip install pysomq
```

### Run as permanent streaming service

If you want to run the SerialServer as a permanent streamer, please start the module with our specific parameters by

```bash
$ python -m pysomq --serial-port=YourSerialPort --serial-baudrate=YourBaudrate --timeout=1 --streaming-socket=tcp://*:5555 --listening-socket=tcp://*:5556
python -m pysomq --serial-port=YourSerialPort --serial-baudrate=YourBaudrate --timeout=1 --streaming-socket=tcp://*:5555 --listening-socket=tcp://*:5556
```

### Stream from script
Expand Down Expand Up @@ -63,9 +69,12 @@ The default values for calling the module or instantiating the classes are

* --listening-socket / listening_socket: tcp://*:5556 respectively tcp://localhost:5556

## Development
## Contributing

I welcome any contributions, enhancements, and bug-fixes. [Open an issue](https://github.com/casabre/pySoMQ/issues) on GitHub and [submit a pull request](https://github.com/casabre/pySoMQ/pulls).

## License

pySoMQ is 100% free and open-source, under the [MIT license](LICENSE). Use it however you want.

You can get the latest source code from my [Gitlab](https://gitlab.com/serial-over-mq/pysomq) repository. For extension or bugfixes, please create a new branch with final merge request according to [CONTRIBUTING](CONTRIBUTING.MD). Any contribution is appreciated!

Currently, the Linux and Windows versions are tested and verified. OSX
and cygwin support has to be tested.
This package is [Treeware](http://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/casabre/pySoMQ) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[build-system]
requires = ["setuptools>=45.2", "wheel", "setuptools_scm>=6.2"]
build-backend = "setuptools.build_meta"

[tool.black]
line-length = 79

[tool.isort]
profile = "black"
src_paths = ["src", "tests"]

[tool.coverage.run]
source = ["pysomq"]

[tool.coverage.paths]
source = ["src", ".tox/*/site-packages"]

[tool.setuptools_scm]
fallback_version = "0.0.0"
11 changes: 0 additions & 11 deletions pysomq/__init__.py

This file was deleted.

26 changes: 0 additions & 26 deletions pysomq/__main__.py

This file was deleted.

Loading

0 comments on commit f99470b

Please sign in to comment.