Skip to content

Commit

Permalink
Use setuptools instead of poetry + more checks + deploy on tag using …
Browse files Browse the repository at this point in the history
…Travis.
  • Loading branch information
starhel committed Sep 30, 2020
1 parent 828f165 commit 49ca74d
Showing 8 changed files with 81 additions and 248 deletions.
34 changes: 22 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
sudo: false

os: linux
language: python
dist: bionic

python:
- '3.6'
- '3.7'
- '3.8'
- '3.9-dev'
- 'nightly'
- 'pypy3'

jobs:
include:
- python: 3.6
dist: xenial
- python: 3.7
dist: bionic
- python: 3.8-dev
dist: bionic
- python: pypy3
allow_failures:
- python: 3.8-dev
- python: 3.9-dev
- python: nightly

install:
- pip install poetry tox-travis
- pip install tox-travis codecov

script:
- tox

after_success:
- codecov

deploy:
provider: pypi
username: "__token__"
password:
secure: dryEPd4Z3r6/CkDqqFFhRM72FIlghQd8Fg2hQYrVJyurBVxD2IJD9Gg6Z1K9n77L1dxv4rK4LmuSQ1vkjV5/gq3i8YgmU4qg3BQ13XrUqQXd6fiLU1Re4oQPmYp9ozHLdjltFjdQs6wdzIRzaCzNtQl9ojDvzKY8+SmAAGxzNpVgpCD5BcHPje1/nqfG19nNDKPyBpzKBNAtnAql9VtqcpvzawGDEmFr/UVdVwjYhGViaQy89WvhVMHvOexqPusFmU10xDK1KnUHoJTjLSHmFfSjGN59jXlG9H0MEdDvQuz2/28VUC/S7MeVuLZc1yvGCmWZoin/uO+ETYm1r4uvdrBJmdLGKkAs7YYyXuN5rFi24oQUhtICzeUR27Vm6a59LdKhGucrUFEhADDlT8Z3C/ohC+H9j5zMlOC8ma5EEeKJBZSnwxfe4YoJaacu0LRGs5f2MtJQUDuzGl2rbvTwxIiYqywIFmiSRoQZaNEekPQ7x34BvmBf3WN3+20IXb7c5TrBhCWhyJRmfsOUVaPHAN22bR8CGmdOxaqIOqEcD2HIV6H4mOSM4wK3j61KFp7WOgZGi6jS4CReBKSywe+qjc7tiOfhceVE8tCKFEIH7tj7oIs1bvXE+d8wcfZqnkcFTyLVOrMi4Qg8FG7jX5kAusVTwW3TeVlce/tw8YR9Tus=
on:
tags: true
distributions: "sdist bdist_wheel"
2 changes: 1 addition & 1 deletion dataslots/__init__.py
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ def with_slots(*args, **kwargs):
return dataslots(*args, **kwargs)


def dataslots(_cls=None, *, add_dict=False, add_weakref=False):
def dataslots(_cls=None, *, add_dict: bool = False, add_weakref: bool = False):
"""
Decorator to add __slots__ to class created by dataclass. Returns new class object as it's not possible
to add __slots__ after class creation.
176 changes: 0 additions & 176 deletions poetry.lock

This file was deleted.

32 changes: 8 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
[tool.poetry]
name = "dataslots"
version = "1.0.1"
description = "Decorator to add __slots__ in dataclasses"
authors = ["Adrian Stachlewski <starhel.github@gmail.com>"]
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers"
]
license = "MIT"
readme = "README.md"
repository = "https://github.com/starhel/dataslots"
keywords=['dataslots', 'slots', 'dataclasses']

[tool.poetry.dependencies]
python = "^3.6"
dataclasses = { version = ">=0.6", python = "~3.6" }

[tool.poetry.dev-dependencies]
pytest = "^5.0"
pytest-cov = "^2.7"
[tool.setuptools_scm]
local_scheme = "node-and-timestamp"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
requires = [
"setuptools>=42",
"wheel",
"setuptools_scm[toml]>=3.4"
]
build-backend = "setuptools.build_meta"
32 changes: 32 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[metadata]
name = dataslots
description = Decorator to add __slots__ in dataclasses
long_description = file: README.md
long_description_content_type = text/markdown
license = MIT
license_file = LICENSE
author = Adrian Stachlewski
author_email = starhel.github@gmail.com
url = https://github.com/starhel/dataslots
project_urls =
Source = https://github.com/starhel/dataslots
Tracker = https://github.com/starhel/dataslots/issues
Documentation = https://github.com/starhel/dataslots
classifiers =
Development Status :: 5 - Production/Stable
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Intended Audience :: Developers
keywords = dataslots slots dataclasses

[options]
python_requires = >=3.6
install_requires =
dataclasses>=0.6;python_version=="3.6"
packages = dataslots

[bdist_wheel]
universal = 1
31 changes: 0 additions & 31 deletions setup.py

This file was deleted.

Empty file added tests/__init__.py
Empty file.
22 changes: 18 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
[tox]
minversion = 3.20.0
isolated_build = true
envlist = py{36,37,38}, pypy3
envlist = py{36,37,38,39}, pypy3

[testenv]
whitelist_externals = poetry
deps =
pytest >= 6.1
pytest-cov >= 2.10
commands =
poetry install -v
poetry run pytest tests/
pytest --cov=dataslots --cov-branch --cov-fail-under=100 --cov-report=term tests/

[testenv:linter]
basepython = python3.7
deps =
flake8
mypy
commands =
flake8 --max-line-length 119 dataslots
mypy dataslots

[travis]
py37: py37, linter

0 comments on commit 49ca74d

Please sign in to comment.