Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nomore py/deprecated #168

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: build

on: [push, pull_request]
on:
push:
branches:
- main
- master
- '*deploy*'
tags:
- v*
pull_request:


jobs:
tests:
Expand All @@ -10,8 +19,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
python: ["3.7","3.8","3.10","3.11", "pypy-3.7"]
os: [windows-latest, ubuntu-latest] #, osx-latest]
python: ["3.8","3.10","3.11", "pypy-3.8"]

steps:
- uses: actions/checkout@v3
Expand All @@ -21,10 +30,12 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install tox
run: pip install tox
- name: Install hatch
run: pip install hatch
- id: pyname_fix
run: python -c "import sys;print('pyversion=' + sys.argv[1].replace('pypy-', 'pypy'))" ${{ matrix.python }} >> $GITHUB_OUTPUT
- name: Test
run: tox -e py
run: hatch run +py=${{ steps.pyname_fix.outputs.pyversion }} test:test --color=yes

deploy:

Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
doc/_build
build/
execnet.egg-info/
execnet/_version.py
src/execnet/_version.py
dist/
.pytest_cache/
.eggs/
Expand Down
9 changes: 6 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
exclude: doc/en/example/py2py3/test_py2.py
repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
Expand All @@ -23,12 +22,12 @@ repos:
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py38-plus]
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
hooks:
- id: reorder-python-imports
args: ['--application-directories=execnet', --py37-plus]
args: ['--application-directories=execnet', --py38-plus, "--remove-import=import py"]
- repo: https://github.com/PyCQA/doc8
rev: 'v1.1.1'
hooks:
Expand All @@ -39,3 +38,7 @@ repos:
rev: 'v0.991'
hooks:
- id: mypy
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "0.4.1"
hooks:
- id: pyproject-fmt
21 changes: 13 additions & 8 deletions doc/example/conftest.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import os
import sys
from pathlib import Path

import py

def _add_path(path: Path):
strpath = os.fspath(path)
if strpath not in sys.path:
sys.path.insert(0, strpath)


mydir = Path(__file__).parent
# make execnet and example code importable
cand = py.path.local(__file__).dirpath().dirpath().dirpath()
if cand.join("execnet", "__init__.py").check():
if str(cand) not in sys.path:
sys.path.insert(0, str(cand))
cand = py.path.local(__file__).dirpath()
if str(cand) not in sys.path:
sys.path.insert(0, str(cand))

cand = mydir.parent.parent
if cand.joinpath("execnet", "__init__.py").is_file():
_add_path(cand)
_add_path(mydir)
pytest_plugins = ["doctest"]
127 changes: 0 additions & 127 deletions doc/example/svn-sync-repo.py

This file was deleted.

16 changes: 8 additions & 8 deletions doc/example/sysinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import sys

import execnet
import py


parser = optparse.OptionParser(usage=__doc__)
Expand All @@ -34,14 +33,15 @@


def parsehosts(path):
path = py.path.local(path)
host_regex = re.compile(r"Host\s*(\S+)")
l = []
rex = re.compile(r"Host\s*(\S+)")
for line in path.readlines():
m = rex.match(line)
if m is not None:
(sshname,) = m.groups()
l.append(sshname)

with open(path) as fp:
for line in fp:
m = rex.match(line)
if m is not None:
(sshname,) = m.groups()
l.append(sshname)
return l


Expand Down
2 changes: 1 addition & 1 deletion doc/example/test_funcmultiplier.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def test_function():
import funcmultiplier
import funcmultiplier # type: ignore[import]
72 changes: 56 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"hatchling",
"hatch-vcs",
"hatch-vcs",
"hatchling",
]
build-backend = "hatchling.build"

[project]
name = "execnet"
dynamic = ["version"]
description = "execnet: rapid multi-Python deployment"
long_description_file = "README.rst"
readme = "README.rst"
license = "MIT"
requires-python = ">=3.7"
authors = [
{ name = "holger krekel and others" },
]
requires-python = ">=3.7"
dynamic = [
"version",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand All @@ -33,25 +35,63 @@ classifiers = [
"Topic :: System :: Distributed Computing",
"Topic :: System :: Networking",
]

[project.optional-dependencies]
dev = [
"hatch",
]
docs = [
"pyyaml",
"sphinx",
]
testing = [
"pre-commit",
"pytest",
"tox",
"hatch",
"pytest",
"pytest-timeout",
]

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


[tool.pytest.ini_options]
timeout = 20
addopts = "-ra"
testpaths = ["testing"]


[tool.hatch.version]
source = "vcs"

[tool.hatch.envs.test]
features = ["testing"]

[[tool.hatch.envs.test.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "pypy3.8"]

[tool.hatch.envs.test.scripts]
test = "pytest {args:testing}"


[tool.hatch.envs.docs]
features = ["docs"]

[tool.hatch.envs.docs.scripts]
html = "sphinx-build -W -b html doc doc/_build"


[tool.hatch.envs.pre-commit]
detached = true
dependences = ["pre-commit>=2.20.0"]

[tool.hatch.envs.pre-commit.scripts]
all = "pre-commit run --all-files --show-diff-on-failure"

[tool.hatch.build.hooks.vcs]
version-file = "execnet/_version.py"
version-file = "src/execnet/_version.py"

[tool.hatch.build.targets.sdist]
include = [
"/execnet",
]
[tool.hatch.build]
sources = ["src"]


[tool.mypy]
python_version = "3.8"
mypy_path = "$MYPY_CONFIG_FILE_DIR/src"
1 change: 1 addition & 0 deletions execnet/__init__.py → src/execnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
(c) 2012, Holger Krekel and others
"""
from ._version import version as __version__
from .gateway_base import Channel
from .gateway_base import DataFormatError
from .gateway_base import dump
from .gateway_base import dumps
Expand Down
Loading