Browse Source

module: adopt poetry dependency manager

master
cn 1 month ago
parent
commit
1b3fc8f2df
7 changed files with 31 additions and 45 deletions
  1. +2
    -1
      .gitignore
  2. +4
    -15
      .travis.yml
  3. +0
    -14
      Pipfile
  4. +23
    -0
      pyproject.toml
  5. +0
    -13
      setup.py
  6. +1
    -1
      tests/veml6070_test.py
  7. +1
    -1
      veml6070/veml6070.py

+ 2
- 1
.gitignore View File

@@ -1,4 +1,5 @@
.pytest_cache/
__pycache__/
*.egg-info/
*.py[cod]
Pipfile.lock
poetry.lock

+ 4
- 15
.travis.yml View File

@@ -8,21 +8,10 @@ python:
- "3.7"
- "3.8"

jobs:
fast_finish: true
allow_failures:
- python: "3.4"
- python: "3.5"
- python: "3.7"
- python: "3.8"

env:
- PIPENV_VERBOSITY=-1

install:
- pip install --upgrade pipenv
- pipenv install --dev
- pip install poetry
- poetry install

script:
- pylint veml6070
- pytest
- poetry run pylint veml6070
- poetry run pytest

+ 0
- 14
Pipfile View File

@@ -1,14 +0,0 @@
[[source]]
url = 'https://pypi.python.org/simple'

[requires]
python_version = '2.7'

[packages]
smbus2 = '*'

[dev-packages]
mock = '*'
pylint = '< 2'
pytest = '< 5'
snapshottest = '*'

+ 23
- 0
pyproject.toml View File

@@ -0,0 +1,23 @@
[build-system]
requires = ["poetry>=1.0"]
build-backend = "poetry.masonry.api"

[tool.poetry]
name = "veml6070"
version = "1.0.0"
description = "A python library for accessing the VEML6070 digital UV light sensor from Vishay."
authors = ["Christian Nicolai"]
license = "MIT"
homepage = "https://dev.mycrobase.de/gitea/cn/python-veml6070"

[tool.poetry.dependencies]
python = "^2.7 || ^3.4"
smbus2 = "*"

[tool.poetry.dev-dependencies]
mock = "*"
pylint = "*"
pytest = "*"
snapshottest = "*"
rope = "*"
yapf = "*"

+ 0
- 13
setup.py View File

@@ -1,13 +0,0 @@
from setuptools import setup

setup(name='veml6070',
version='1.0.0',
packages=['veml6070'],

install_requires=['smbus2'],
python_requires='>=2.7',

url='https://dev.mycrobase.de/gitea/cn/python-veml6070',
author='Christian Nicolai',
description=' A python library for accessing the VEML6070 digital UV light sensor from Vishay.',
long_description=open('README.md').read())

+ 1
- 1
tests/veml6070_test.py View File

@@ -14,7 +14,7 @@ time.sleep = lambda s: None
import veml6070

# inspired by https://github.com/adafruit/Adafruit_Python_GPIO/blob/master/Adafruit_GPIO/I2C.py
class MockSMBus(object):
class MockSMBus(object): # pylint: disable=bad-option-value,useless-object-inheritance
def __init__(self, initial_read=None):
self._log = []
self.initial_read = initial_read or {}


+ 1
- 1
veml6070/veml6070.py View File

@@ -31,7 +31,7 @@ NORMALIZED_REFRESHTIME = 0.1
# normalized to the NORMALIZED_REFRESHTIME, for RSET_240K and INTEGRATIONTIME_1T
NORMALIZED_UVA_SENSITIVITY = 0.05

class Veml6070(object):
class Veml6070(object): # pylint: disable=bad-option-value,useless-object-inheritance

def __init__(self, i2c_bus=1, sensor_address=ADDR_L, rset=RSET_270K, integration_time=INTEGRATIONTIME_1T):
self.bus = smbus.SMBus(i2c_bus)


Loading…
Cancel
Save