Skip to content

Commit 6723f10

Browse files
committed
set up workflow to mirror modern projects
1 parent c803e4e commit 6723f10

File tree

13 files changed

+326
-174
lines changed

13 files changed

+326
-174
lines changed

.github/workflows/ci.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-20.04
14+
strategy:
15+
matrix:
16+
python_version: ["3.8", "3.9", "3.10"]
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v3
20+
- name: Setup nox
21+
uses: daisylb/[email protected]
22+
- name: Setup poetry
23+
uses: Gr1N/setup-poetry@v7
24+
- name: Install dependencies
25+
run: |
26+
poetry install --all-extras --with dev
27+
pip install nox-poetry
28+
- name: Run tests
29+
run: nox -s test-${{ matrix.python_version }}
30+
- name: Generate coverage XML
31+
run: nox -s generate_coverage_xml
32+
- name: Upload coverage to Codecov
33+
uses: codecov/codecov-action@v3
34+
lint:
35+
runs-on: ubuntu-20.04
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v3
39+
- name: Setup nox
40+
uses: daisylb/[email protected]
41+
- name: Setup poetry
42+
uses: Gr1N/setup-poetry@v7
43+
- name: Install dependencies
44+
run: |
45+
poetry install --all-extras --with dev
46+
pip install nox-poetry
47+
- name: Run lint
48+
run: nox -s lint
49+
- name: Type checking
50+
run: |
51+
poetry run mypy vdom/

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

noxfile.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import nox
2+
import nox_poetry
3+
4+
LINT_PATHS = ["vdom", "noxfile.py"]
5+
6+
nox.options.reuse_existing_virtualenv = True
7+
nox.options.sessions = ["lint", "test"]
8+
9+
10+
@nox_poetry.session(python=["3.8", "3.9", "3.10"])
11+
def test(session: nox_poetry.Session):
12+
session.run_always("poetry", "install", external=True)
13+
session.run("pytest", "-v", "--cov=vdom")
14+
15+
16+
@nox_poetry.session(python="3.9")
17+
def generate_coverage_xml(session: nox_poetry.Session):
18+
session.install("coverage[toml]")
19+
session.run("coverage", "xml")
20+
21+
22+
@nox_poetry.session(python="3.9")
23+
def lint(session: nox_poetry.Session):
24+
session.notify("black_check")
25+
session.notify("flake8")
26+
session.notify("isort_check")
27+
28+
29+
@nox_poetry.session(python="3.9")
30+
def flake8(session: nox_poetry.Session):
31+
session.install("flake8")
32+
session.run("flake8", *LINT_PATHS, "--count", "--show-source", "--statistics", "--benchmark")
33+
34+
35+
@nox_poetry.session(python="3.9")
36+
def black_check(session: nox_poetry.Session):
37+
session.install("black")
38+
session.run("black", "--check", *LINT_PATHS)
39+
40+
41+
@nox_poetry.session(python="3.9")
42+
def isort_check(session: nox_poetry.Session):
43+
session.install("isort")
44+
session.run("isort", "--diff", "--profile", "black", "--check", *LINT_PATHS)
45+
46+
47+
@nox_poetry.session(python="3.9")
48+
def blacken(session: nox_poetry.Session):
49+
session.install("black")
50+
session.run("black", *LINT_PATHS)
51+
52+
53+
@nox_poetry.session(python="3.9")
54+
def isort_apply(session: nox_poetry.Session):
55+
session.install("isort")
56+
session.run("isort", *LINT_PATHS, "--profile", "black")

poetry.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[virtualenvs]
2+
create = true
3+
in-project = true

pyproject.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,32 @@ exclude = '''
2727
)/
2828
'''
2929
skip-string-normalization = true
30+
31+
[tool.poetry]
32+
name = "vdom"
33+
version = "0.1.0"
34+
description = ""
35+
authors = ["Kyle Kelley <[email protected]>"]
36+
readme = "README.md"
37+
38+
[tool.poetry.dependencies]
39+
python = "^3.8"
40+
ipython = "^8.11.0"
41+
jsonschema = "^4.17.3"
42+
43+
[tool.poetry.group.dev.dependencies]
44+
types-jsonschema = "^4.17.0.6"
45+
pytest = "^7.2.2"
46+
mypy = "^1.1.1"
47+
flake8-docstrings = "^1.7.0"
48+
black = "^23.1.0"
49+
isort = "^5.12.0"
50+
pytest-cov = "^4.0.0"
51+
pytest-asyncio = "^0.21.0"
52+
nox = "^2022.11.21"
53+
nox-poetry = "^1.0.2"
54+
pytest-mock = "^3.10.0"
55+
56+
[build-system]
57+
requires = ["poetry-core"]
58+
build-backend = "poetry.core.masonry.api"

setup.cfg

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
[metadata]
2+
name = vdom
3+
author = nteract contributors
4+
author_email = [email protected]
5+
license = BSD
6+
description = VDOM for Python
7+
keywords = vdom,, html
8+
url = https://github.com/nteract/vdom
9+
long_description = file: README.md
10+
long_description_content_type = text/markdown
11+
12+
[options]
13+
packages = vdom
14+
install_requires = ipython; jsonschema
15+
include_package_data = True
16+
17+
[options.extras_require]
18+
tests = pytest
19+
all = pytest
20+
21+
[options.package_data]
22+
vdom = schemas/vdom_schema_v0.json
123

224
[flake8]
325
# References:
@@ -7,6 +29,8 @@
729
# Note: there cannot be spaces after comma's here
830
exclude = __init__.py
931
ignore =
32+
# Length of line
33+
E501,
1034
# Extra space in brackets
1135
E20,
1236
# Multiple spaces around ","

setup.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

vdom/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
from ._version import get_versions
12
from .core import *
23
from .helpers import *
34

4-
from ._version import get_versions
5-
65
__version__ = get_versions()['version']
76
del get_versions
87

98
from . import _version
9+
1010
__version__ = _version.get_versions()['version']

0 commit comments

Comments
 (0)