Skip to content

Commit

Permalink
Use pyproject.toml instead of setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
vxgmichel committed Aug 31, 2024
1 parent e55f4b0 commit 8716eee
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 59 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,17 @@ jobs:
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install setuptools
run: pip install -U setuptools
if: ${{ matrix.python-version == '3.12' }}
- name: Install test requirements
run: pip install -r test-requirements.txt
run: pip install -e .[dev]
- name: Run tests
run: python setup.py test
run: pytest
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
Expand All @@ -53,13 +51,11 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Build source distribution
run: python setup.py sdist
- name: Build wheel
python-version: 3.8
- name: Build wheel and source distribution
run: |
pip install wheel
python setup.py bdist_wheel
pip install build
python -m build --sdist --wheel
- name: Publish source package on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/ambv/black
rev: 23.3.0
rev: 24.3.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: 7.0.0
hooks:
- id: flake8
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.272
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix, --ignore, "E501,F403" ]
args: [ --fix, --exit-non-zero-on-fix]
3 changes: 3 additions & 0 deletions aioconsole/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from .server import start_interactive_server
from .apython import run_apython


__version__ = "0.7.2.dev0"

__all__ = [
"aexec",
"ainput",
Expand Down
2 changes: 1 addition & 1 deletion aioconsole/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(
locals=None,
banner=None,
serve=None,
prompt_control=None
prompt_control=None,
):
self.console = None
self.console_task = None
Expand Down
2 changes: 1 addition & 1 deletion aioconsole/rlwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def rlwrap_process(args, prompt_control, use_stderr=False):
bufsize=0,
universal_newlines=True,
stdin=subprocess.PIPE,
**{"stderr" if use_stderr else "stdout": subprocess.PIPE}
**{"stderr" if use_stderr else "stdout": subprocess.PIPE},
)
# Readline wrapping
return _rlwrap(process, prompt_control, use_stderr)
Expand Down
59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[build-system]
requires = ["setuptools >= 69.5"]
build-backend = "setuptools.build_meta"

[project]
name = "aioconsole"
dynamic = ["version"]
description = "Asynchronous console and interfaces for asyncio"
readme = {file = "README.rst", content-type = "text/x-rst"}
license = {file = "LICENSE"}
requires-python = ">=3.8"
authors = [
{ name = "Vincent Michel", email = "[email protected]" },
]
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
]

[project.optional-dependencies]
dev = [
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-repeat",
'uvloop; python_implementation != "PyPy" and sys_platform != "win32"',
]

[tool.setuptools]
packages = ["aioconsole"]

[tool.setuptools.dynamic]
version = {attr = "aioconsole.__version__"}

[project.scripts]
apython = "aioconsole:run_apython"

[project.urls]
Homepage = "https://github.com/vxgmichel/aioconsole"

[tool.pytest.ini_options]
addopts = "--strict-markers --cov aioconsole"
testpaths = ["tests"]

[tool.black]
line-length = 88
target_version = ["py38", "py39", "py310", "py311", "py312"]

[tool.coverage.report]
exclude_also = ["if TYPE_CHECKING:", "assert False"]

[tool.ruff]
ignore = ["E501", "F403"]
43 changes: 0 additions & 43 deletions setup.py

This file was deleted.

0 comments on commit 8716eee

Please sign in to comment.