Compare commits

...

10 Commits

Author SHA1 Message Date
Lucidiot 1f7cac1d8c
Update pre-commit hooks
continuous-integration/drone/push Build is passing Details
2023-05-09 13:06:37 +02:00
Lucidiot ac6a1b3103
Add Python 3.11 in CI
continuous-integration/drone Build is failing Details
2023-05-09 12:48:18 +02:00
~lucidiot 04e3354394
Split PyPI secrets
continuous-integration/drone/push Build is passing Details
2022-08-09 14:19:14 +02:00
~lucidiot 91918e8d41
Bump to 0.4.3
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build is passing Details
2022-08-05 01:53:28 +02:00
~lucidiot e3a89613e1
Updates due to Tildegit move 2022-08-05 01:53:08 +02:00
~lucidiot 4438f17e94
Bump to 0.4.2 2022-02-08 22:44:56 +01:00
~lucidiot 70b155cf04
Fix missing files in source packages 2022-02-08 22:43:02 +01:00
~lucidiot d6becffcc0
Bump to 0.4.1 2022-01-26 19:19:40 +01:00
~lucidiot 27cc5de1b9 Merge branch 'manifest' into 'master'
Add MANIFEST.in

Closes #21

See merge request Lucidiot/pylspci!19
2022-01-26 18:19:26 +00:00
~lucidiot 1936c58dec
Add MANIFEST.in 2022-01-26 19:17:26 +01:00
13 changed files with 166 additions and 125 deletions

120
.drone.yml Normal file
View File

@ -0,0 +1,120 @@
---
kind: pipeline
type: docker
name: default
steps:
- name: pre-commit
image: python:3-alpine
commands:
- apk add --no-cache git gcc musl-dev
- pip install .[dev]
- pre-commit run -a
- name: test-py36
image: python:3.6-alpine
commands:
- pip install .[dev]
- coverage run setup.py test
- coverage report
- name: test-py37
image: python:3.7-alpine
commands:
- pip install .[dev]
- coverage run setup.py test
- coverage report
- name: test-py38
image: python:3.8-alpine
commands:
- pip install .[dev]
- coverage run setup.py test
- coverage report
- name: test-py39
image: python:3.9-alpine
commands:
- pip install .[dev]
- coverage run setup.py test
- coverage report
- name: test-py310
image: python:3.10-alpine
commands:
- pip install .[dev]
- coverage run setup.py test
- coverage report
- name: test-py311
image: python:3.11-alpine
commands:
- pip install .[dev]
- coverage run setup.py test
- coverage report
- name: testpypi
image: python:3.11-alpine
commands:
- pip install .[dev] twine setuptools wheel
- |
echo "[distutils]
index-servers = testpypi
[testpypi]
repository=https://test.pypi.org/legacy/
username=$$TESTPYPI_DEPLOY_USERNAME
password=$$TESTPYPI_DEPLOY_PASSWORD" > ~/.pypirc
- python setup.py sdist bdist_wheel
- twine upload dist/* -r testpypi
when:
event:
- promote
repo:
- lucidiot/pylspci
depends_on:
- pre-commit
- test-py36
- test-py37
- test-py38
- test-py39
- test-py310
- test-py311
environment:
TESTPYPI_DEPLOY_USERNAME:
from_secret: testpypi_username
TESTPYPI_DEPLOY_PASSWORD:
from_secret: testpypi_password
- name: pypi
image: python:3.11-alpine
commands:
- pip install .[dev] twine setuptools wheel
- |
echo "[distutils]
index-servers = pypi
[pypi]
repository=https://upload.pypi.org/legacy/
username=$$PYPI_DEPLOY_USERNAME
password=$$PYPI_DEPLOY_PASSWORD" > ~/.pypirc
- python setup.py sdist bdist_wheel
- twine upload dist/* -r pypi
when:
event:
- promote
repo:
- lucidiot/pylspci
branch:
- master
depends_on:
- testpypi
environment:
PYPI_DEPLOY_USERNAME:
from_secret: pypi_username
PYPI_DEPLOY_PASSWORD:
from_secret: pypi_password

View File

@ -1,90 +0,0 @@
image: python:3.9
stages:
- test
- deploy
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip
- venv/
before_script:
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install .[dev]
tests:
stage: test
coverage: '/TOTAL[\s\d]+\s(\d+%)/'
script:
- coverage run setup.py test
- coverage report
- codecov
pre-commit:
stage: test
script:
- pre-commit run -a
deploy-pypi:
stage: deploy
when: manual
only:
- master@Lucidiot/pylspci
environment:
name: pypi
url: https://pypi.org/project/pylspci
script:
- pip install twine setuptools wheel
- echo "[distutils]" > ~/.pypirc
- echo "index-servers =" >> ~/.pypirc
- echo " pypi" >> ~/.pypirc
- echo "[pypi]" >> ~/.pypirc
- echo "repository=https://upload.pypi.org/legacy/" >> ~/.pypirc
- echo "username=$PYPI_DEPLOY_USERNAME" >> ~/.pypirc
- echo "password=$PYPI_DEPLOY_PASSWORD" >> ~/.pypirc
- python setup.py sdist bdist_wheel
- twine upload dist/* -r pypi
deploy-testpypi:
stage: deploy
when: manual
only:
- branches@Lucidiot/pylspci
environment:
name: testpypi
url: https://test.pypi.org/project/pylspci
script:
- pip install twine setuptools wheel
- echo "[distutils]" > ~/.pypirc
- echo "index-servers =" >> ~/.pypirc
- echo " testpypi" >> ~/.pypirc
- echo "[testpypi]" >> ~/.pypirc
- echo "repository=https://test.pypi.org/legacy/" >> ~/.pypirc
- echo "username=$PYPI_DEPLOY_USERNAME" >> ~/.pypirc
- echo "password=$PYPI_DEPLOY_PASSWORD" >> ~/.pypirc
- python setup.py sdist bdist_wheel
- twine upload dist/* -r testpypi
pages:
stage: deploy
when: manual
needs:
- pre-commit
only:
- master@Lucidiot/pylspci
artifacts:
paths:
- public
script:
- cd docs
- make html
- mv _build/html ../public

View File

@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks # See https://pre-commit.com/hooks.html for more hooks
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1 rev: v4.4.0
hooks: hooks:
- id: trailing-whitespace - id: trailing-whitespace
- id: end-of-file-fixer - id: end-of-file-fixer
@ -11,12 +11,12 @@ repos:
- id: check-merge-conflict - id: check-merge-conflict
- id: check-executables-have-shebangs - id: check-executables-have-shebangs
- id: check-symlinks - id: check-symlinks
- repo: https://gitlab.com/PyCQA/flake8 - repo: https://github.com/PyCQA/flake8
rev: 3.9.2 rev: 6.0.0
hooks: hooks:
- id: flake8 - id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910 rev: v1.2.0
hooks: hooks:
- id: mypy - id: mypy
args: args:
@ -26,10 +26,10 @@ repos:
- --check-untyped-defs - --check-untyped-defs
- --no-implicit-optional - --no-implicit-optional
- repo: https://github.com/PyCQA/doc8 - repo: https://github.com/PyCQA/doc8
rev: 0.9.0 rev: v1.1.1
hooks: hooks:
- id: doc8 - id: doc8
- repo: https://github.com/PyCQA/isort - repo: https://github.com/PyCQA/isort
rev: 5.9.3 rev: 5.12.0
hooks: hooks:
- id: isort - id: isort

6
MANIFEST.in Normal file
View File

@ -0,0 +1,6 @@
include requirements.txt
include requirements-dev.txt
include VERSION
include LICENSE
include README.rst
include pylspci/py.typed

View File

@ -5,4 +5,4 @@ A Python parser for the ``lspci`` command from the pciutils_ package.
`Browse documentation`_ `Browse documentation`_
.. _pciutils: http://mj.ucw.cz/sw/pciutils/ .. _pciutils: http://mj.ucw.cz/sw/pciutils/
.. _Browse documentation: https://lucidiot.gitlab.io/pylspci/ .. _Browse documentation: https://lucidiot.tildepages.org/pylspci/

View File

@ -1 +1 @@
0.4.0 0.4.3

View File

@ -21,7 +21,7 @@ sys.path.insert(0, os.path.abspath('..'))
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
project = 'pylspci' project = 'pylspci'
copyright = '2019, Lucidiot and contributors' copyright = '2022, Lucidiot and contributors'
author = 'Lucidiot and contributors' author = 'Lucidiot and contributors'
# The short X.Y version # The short X.Y version
@ -62,7 +62,7 @@ master_doc = 'index'
# #
# This is also used if you do content translation via gettext catalogs. # This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases. # Usually you set "language" from the command line for these cases.
language = None language = 'en'
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.

View File

@ -6,8 +6,8 @@ Contributions to the project are greatly appreciated.
Bugs and suggestions Bugs and suggestions
-------------------- --------------------
You may `submit an issue`_ to GitLab to warn of any bugs, ask for new features, You may `submit an issue`_ to the Gitea repository to warn of any bugs, ask for
or ask any questions that are not answered in this documentation. new features, or ask any questions that are not answered in this documentation.
When reporting a bug, do not forget to put in your version of Python and your When reporting a bug, do not forget to put in your version of Python and your
version of *pylspci*. This will greatly help when troubleshooting, as most version of *pylspci*. This will greatly help when troubleshooting, as most
@ -22,7 +22,7 @@ Setup
You will need a virtual envionment to work properly. `virtualenvwrapper`_ is You will need a virtual envionment to work properly. `virtualenvwrapper`_ is
recommended:: recommended::
git clone https://gitlab.com/Lucidiot/pylspci git clone https://tildegit.org/lucidiot/pylspci.git
cd pylspci cd pylspci
mkvirtualenv -a . pylspci mkvirtualenv -a . pylspci
pip install -e .[dev] pip install -e .[dev]
@ -44,8 +44,8 @@ Tests coverage
I aim for 100% coverage on all of my Python packages whenever I add unit I aim for 100% coverage on all of my Python packages whenever I add unit
tests to them; this package is no exception. CI checks use the `coverage`_ tests to them; this package is no exception. CI checks use the `coverage`_
Python package and `codecov`_ to check for test coverage. To get test coverage Python package to get coverage statistics.
data locally, run:: To get test coverage data locally, run::
coverage run setup.py test coverage run setup.py test
@ -60,7 +60,7 @@ offline using your favorite web browser and shows line by line coverage::
If you are having issues reaching 100% coverage, try to still add some tests, If you are having issues reaching 100% coverage, try to still add some tests,
and mention your issues when creating a pull request to the and mention your issues when creating a pull request to the
`GitLab repository`_. `Gitea repository`_.
Linting Linting
^^^^^^^ ^^^^^^^
@ -82,13 +82,12 @@ Documentation
The documentation you are reading is generated by the `Sphinx`_ tool. The documentation you are reading is generated by the `Sphinx`_ tool.
The text files that hold the documentation's contents are written in The text files that hold the documentation's contents are written in
`reStructuredText`_ and are available under the ``/docs`` folder of the `reStructuredText`_ and are available under the ``/docs`` folder of the
`GitLab repository`_. `Gitea repository`_.
They are also subject to linting using the ``doc8`` tool. They are also subject to linting using the ``doc8`` tool.
.. _submit an issue: https://gitlab.com/Lucidiot/pylspci/issues/new .. _submit an issue: https://tildegit.org/lucidiot/pylspci/issues/new
.. _virtualenvwrapper: https://virtualenvwrapper.readthedocs.io .. _virtualenvwrapper: https://virtualenvwrapper.readthedocs.io
.. _coverage: https://coverage.readthedocs.io/ .. _coverage: https://coverage.readthedocs.io/
.. _codecov: https://codecov.io/gl/Lucidiot/pylspci .. _Gitea repository: https://tildegit.org/lucidiot/pylspci
.. _GitLab repository: https://gitlab.com/Lucidiot/pylspci
.. _Sphinx: http://www.sphinx-doc.org/ .. _Sphinx: http://www.sphinx-doc.org/
.. _reStructuredText: http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html .. _reStructuredText: http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html

View File

@ -18,14 +18,11 @@ Python lspci parser
.. image:: https://img.shields.io/pypi/status/pylspci.svg .. image:: https://img.shields.io/pypi/status/pylspci.svg
:target: https://pypi.org/project/pylspci :target: https://pypi.org/project/pylspci
.. image:: https://gitlab.com/Lucidiot/pylspci/badges/master/pipeline.svg .. image:: https://drone.tildegit.org/api/badges/lucidiot/pylspci/status.svg
:target: https://gitlab.com/Lucidiot/pylspci/pipelines :target: https://drone.tildegit.org/api/badges/lucidiot/pylspci/status.svg
.. image:: https://codecov.io/gl/Lucidiot/pylspci/branch/master/graph/badge.svg .. image:: https://img.shields.io/badge/badge%20count-7-brightgreen.svg
:target: https://codecov.io/gl/Lucidiot/pylspci :target: https://tildegit.org/lucidiot/pylspci
.. image:: https://img.shields.io/badge/badge%20count-8-brightgreen.svg
:target: https://gitlab.com/Lucidiot/pylspci
A Python parser for the ``lspci`` command from the pciutils_ package. A Python parser for the ``lspci`` command from the pciutils_ package.

View File

@ -8,7 +8,7 @@ from pylspci.parsers.base import Parser
UNKNOWN_FIELD_WARNING = ( UNKNOWN_FIELD_WARNING = (
'Unsupported device field {!r} with value {!r}\n' 'Unsupported device field {!r} with value {!r}\n'
'Please report this, along with the output of `lspci -mmnnvvvk`, at ' 'Please report this, along with the output of `lspci -mmnnvvvk`, at '
'https://gitlab.com/Lucidiot/pylspci/issues' 'https://tildegit.org/lucidiot/pylspci/issues/new'
) )

View File

@ -87,7 +87,7 @@ class TestVerboseParser(TestCase):
msg="Unsupported device field 'NewField' with value 'Value'\n" msg="Unsupported device field 'NewField' with value 'Value'\n"
"Please report this, along with the output of" "Please report this, along with the output of"
"`lspci -mmnnvvvk`, at " "`lspci -mmnnvvvk`, at "
"https://gitlab.com/Lucidiot/pylspci/issues"): "https://tildegit.org/lucidiot/pylspci/issues/new"):
devices: List[Device] = \ devices: List[Device] = \
self.parser.parse(SAMPLE_DEVICE + 'NewField\tValue') self.parser.parse(SAMPLE_DEVICE + 'NewField\tValue')

View File

@ -1,5 +1,4 @@
doc8>=0.8.0 doc8>=0.8.0
Sphinx>=1.8.1 Sphinx>=1.8.1
coverage>=4.5 coverage>=4.5
codecov>=2.0
pre-commit>=2.9.2 pre-commit>=2.9.2

View File

@ -22,10 +22,16 @@ setup(
'console_scripts': ['pylspci=pylspci.__main__:main'], 'console_scripts': ['pylspci=pylspci.__main__:main'],
}, },
package_data={ package_data={
'': ['VERSION', 'LICENSE', 'README.rst'], '': [
'VERSION',
'LICENSE',
'README.rst',
'requirements.txt',
'requirements-dev.txt',
],
'pylspci': ['py.typed'], 'pylspci': ['py.typed'],
}, },
python_requires='>=3.5', python_requires='>=3.6',
install_requires=requirements, install_requires=requirements,
extras_require={ extras_require={
'dev': dev_requirements, 'dev': dev_requirements,
@ -36,7 +42,7 @@ setup(
long_description=open('README.rst').read(), long_description=open('README.rst').read(),
long_description_content_type='text/x-rst', long_description_content_type='text/x-rst',
keywords="lspci parser", keywords="lspci parser",
url="https://gitlab.com/Lucidiot/pylspci", url="https://tildegit.org/lucidiot/pylspci",
classifiers=[ classifiers=[
"Development Status :: 4 - Beta", "Development Status :: 4 - Beta",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
@ -48,13 +54,17 @@ setup(
"Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries",
"Topic :: System :: Hardware", "Topic :: System :: Hardware",
"Topic :: Utilities", "Topic :: Utilities",
"Typing :: Typed", "Typing :: Typed",
], ],
project_urls={ project_urls={
"Source Code": "https://gitlab.com/Lucidiot/pylspci", "Homepage": "https://tildegit.org/lucidiot/pylspci",
"GitHub Mirror": "https://github.com/Lucidiot/pylspci", "Changelog": "https://tildegit.org/lucidiot/pylspci/releases",
"Documentation": "https://lucidiot.tildepages.org/pylspci/",
"Issue tracker": "https://tildegit.org/lucidiot/pylspci/issues",
} }
) )