Skip to content

Commit 58e9339

Browse files
all in on hatch + pre-commit update
1 parent 08eb3b2 commit 58e9339

26 files changed

+110
-79
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
name: build
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- '*deploy*'
9+
tags:
10+
- v*
11+
pull_request:
12+
413

514
jobs:
615
tests:
@@ -10,19 +19,23 @@ jobs:
1019
strategy:
1120
fail-fast: false
1221
matrix:
13-
os: [windows-latest, ubuntu-latest]
14-
python: ["3.7","3.8","3.10","3.11", "pypy-3.7"]
22+
os: [windows-latest, ubuntu-latest, osx-latest]
23+
python: ["3.7","3.8","3.10","3.11", "pypy-3.7", "pypy-3.8"]
1524

1625
steps:
17-
- uses: actions/checkout@v1
26+
- uses: actions/checkout@v3
27+
with:
28+
fetch-depth: 0
1829
- name: Set up Python
19-
uses: actions/setup-python@v2
30+
uses: actions/setup-python@v4
2031
with:
2132
python-version: ${{ matrix.python }}
22-
- name: Install tox
23-
run: pip install tox
33+
- name: Install hatch
34+
run: pip install hatch
35+
- id: pyname_fix
36+
run: python -c "import sys;print('pyversion=' + sys.argv[1].replace('pypy-', 'pypy'))" ${{ matrix.python }} >> $GITHUB_OUTPUT
2437
- name: Test
25-
run: tox -e py
38+
run: hatch run +py=${{ steps.pyname_fix.outputs.pyversion }} test:test --color=yes
2639

2740
deploy:
2841

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
doc/_build
22
build/
3-
execnet.egg-info/
4-
execnet/_version.py
3+
src/execnet/_version.py
54
dist/
65
.pytest_cache/
76
.eggs/

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ repos:
3939
rev: 'v0.991'
4040
hooks:
4141
- id: mypy
42+
- repo: https://github.com/tox-dev/pyproject-fmt
43+
rev: "0.4.1"
44+
hooks:
45+
- id: pyproject-fmt

doc/example/test_funcmultiplier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
def test_function():
2-
import funcmultiplier
2+
import funcmultiplier # type: ignore[import]

pyproject.toml

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
[build-system]
2+
build-backend = "hatchling.build"
23
requires = [
3-
"hatchling",
4-
"hatch-vcs",
4+
"hatch-vcs",
5+
"hatchling",
56
]
6-
build-backend = "hatchling.build"
77

88
[project]
99
name = "execnet"
10-
dynamic = ["version"]
1110
description = "execnet: rapid multi-Python deployment"
12-
long_description_file = "README.rst"
11+
readme = "README.rst"
1312
license = "MIT"
14-
requires-python = ">=3.7"
1513
authors = [
1614
{ name = "holger krekel and others" },
1715
]
16+
requires-python = ">=3.7"
17+
dynamic = [
18+
"version",
19+
]
1820
classifiers = [
1921
"Development Status :: 5 - Production/Stable",
2022
"Intended Audience :: Developers",
@@ -33,29 +35,63 @@ classifiers = [
3335
"Topic :: System :: Distributed Computing",
3436
"Topic :: System :: Networking",
3537
]
36-
3738
[project.optional-dependencies]
39+
dev = [
40+
"hatch",
41+
]
42+
docs = [
43+
"pyyaml",
44+
"sphinx",
45+
]
3846
testing = [
39-
"pre-commit",
40-
"pytest",
41-
"tox",
42-
"hatch",
47+
"pytest",
48+
"pytest-timeout",
4349
]
4450

4551
[project.urls]
4652
Homepage = "https://execnet.readthedocs.io/en/latest/"
4753

54+
55+
[tool.pytest.ini_options]
56+
timeout = 20
57+
addopts = "-ra"
58+
testpaths = ["testing"]
59+
60+
4861
[tool.hatch.version]
4962
source = "vcs"
5063

64+
[tool.hatch.envs.test]
65+
features = ["testing"]
66+
67+
[[tool.hatch.envs.test.matrix]]
68+
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.7","pypy3.8"]
69+
70+
[tool.hatch.envs.test.scripts]
71+
test = "pytest {args:testing}"
72+
73+
74+
[tool.hatch.envs.docs]
75+
features = ["docs"]
76+
77+
[tool.hatch.envs.docs.scripts]
78+
html = "sphinx-build -W -b html doc doc/_build"
79+
80+
81+
[tool.hatch.envs.pre-commit]
82+
detached = true
83+
dependences = ["pre-commit>1.11.0"]
84+
85+
[tool.hatch.envs.pre-commit.scripts]
86+
all = "pre-commit run --all-files --show-diff-on-failure"
87+
5188
[tool.hatch.build.hooks.vcs]
52-
version-file = "execnet/_version.py"
89+
version-file = "src/execnet/_version.py"
5390

54-
[tool.hatch.build.targets.sdist]
55-
include = [
56-
"/execnet",
57-
]
91+
[tool.hatch.build]
92+
sources = ["src"]
5893

5994

6095
[tool.mypy]
6196
python_version = "3.7"
97+
mypy_path = "$MYPY_CONFIG_FILE_DIR/src"

execnet/__init__.py renamed to src/execnet/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
(c) 2012, Holger Krekel and others
88
"""
99
from ._version import version as __version__
10+
from .gateway_base import Channel
1011
from .gateway_base import DataFormatError
1112
from .gateway_base import dump
1213
from .gateway_base import dumps

execnet/gateway.py renamed to src/execnet/gateway.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,7 @@ def rinfo_source(channel):
170170
def _find_non_builtin_globals(source, codeobj):
171171
import ast
172172

173-
try:
174-
import __builtin__
175-
except ImportError:
176-
import builtins as __builtin__
173+
import builtins as __builtin__
177174

178175
vars = dict.fromkeys(codeobj.co_varnames)
179176
return [
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)