Skip to content

Commit

Permalink
Migrate to pyproject.toml (#354)
Browse files Browse the repository at this point in the history
- Deprecate and remove setup.py and setup.cfg
- Deprecate Makefile
- Include pypa-build in the development dependencies
  • Loading branch information
achimnol authored Apr 25, 2023
1 parent 7a1df40 commit 055667c
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 131 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
run: |
pip install -r requirements-dev.txt
- name: Run tests
run: make test
run: python -m pytest -v tests
- name: Upload coverage data
uses: codecov/codecov-action@v3

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ jobs:
python-version: ${{ env.PYTHON_LATEST }}
cache: pip
cache-dependency-path: |
setup.py
pyproject.toml
requirements-dev.txt
- name: Install dependencies
run: |
pip install -U -r requirements-dev.txt
- name: Lint with flake8
run: |
echo "::add-matcher::.github/workflows/flake8-matcher.json"
python -m flake8 aiomonitor/ examples/ tests/ setup.py
python -m flake8 aiomonitor/ examples/ tests/
lint-isort:
name: Lint with isort
Expand All @@ -54,15 +54,15 @@ jobs:
check-latest: true
cache: pip
cache-dependency-path: |
setup.py
pyproject.toml
requirements-dev.txt
requirements-doc.txt
- name: Install dependencies
run: |
pip install -U -r requirements-dev.txt
- name: Lint with isort
run: |
python -m isort --check aiomonitor/ examples/ tests/ setup.py
python -m isort --check aiomonitor/ examples/ tests/
lint-black:
name: Lint with Black
Expand All @@ -79,15 +79,15 @@ jobs:
check-latest: true
cache: pip
cache-dependency-path: |
setup.py
pyproject.toml
requirements-dev.txt
requirements-doc.txt
- name: Install dependencies
run: |
pip install -U -r requirements-dev.txt
- name: Lint with black
run: |
python -m black --check aiomonitor/ examples/ tests/ setup.py
python -m black --check aiomonitor/ examples/ tests/
typecheck-mypy:
name: Check typing and annotations
Expand All @@ -104,7 +104,7 @@ jobs:
check-latest: true
cache: pip
cache-dependency-path: |
setup.py
pyproject.toml
requirements-dev.txt
requirements-doc.txt
- name: Install dependencies
Expand All @@ -113,4 +113,4 @@ jobs:
- name: Typecheck with mypy
run: |
echo "::add-matcher::.github/workflows/mypy-matcher.json"
python -m mypy aiomonitor/ examples/ tests/ setup.py
python -m mypy aiomonitor/ examples/ tests/
19 changes: 10 additions & 9 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,30 @@ Fist of all just clone repository::

$ git clone git@github.com:aio-libs/aiomonitor.git

Create virtualenv with python3.5 (older version are not supported). For example
using *virtualenvwrapper* commands could look like::
Create a virtualenv with Python 3.8 or later. For example,
using *pyenv* commands could look like::

$ cd aiomonitor
$ mkvirtualenv --python=`which python3.5` aiomonitor
$ pyenv virtualenv 3.11 aiomonitor-dev
$ pyenv local aiomonitor-dev


After that please install libraries required for development::
After that please install the dependencies required for development
and the sources as an editable package::

$ pip install -r requirements-dev.txt
$ pip install -e .

Congratulations, you are ready to run the test suite::

$ make cov
$ python -m pytest --cov tests

To run individual use following command::
To run individual tests use the following command::

$ py.test -sv tests/test_monitor.py -k test_name
$ python -m pytest -sv tests/test_monitor.py -k test_name


Reporting an Issue
------------------

If you have found issue with `aiomonitor` please do
not hesitate to file an issue on the GitHub_ project. When filing your
issue please make sure you can express the issue with a reproducible test
Expand Down
55 changes: 0 additions & 55 deletions Makefile

This file was deleted.

51 changes: 51 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]

[project]
name = "aiomonitor"
description = "Adds monitor and Python REPL capabilities for asyncio applications"
readme = {file = "README.rst", content-type = "text/x-rst"}
license = {file = "LICENSE"}
authors = [
{name = "Nikolay Novik", email = "nickolainovik@gmail.com"},
]
maintainers = [
{name = "Joongi Kim", email = "me@daybreaker.info"},
]
classifiers = [
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: POSIX",
"Development Status :: 3 - Alpha",
"Framework :: AsyncIO",
]

dynamic = ["version"]

requires-python = ">=3.8"
dependencies = [
"attrs>=20",
"click>=8",
"janus>=1.0",
"terminaltables",
"typing-extensions>=4.1",
"prompt_toolkit>=3.0",
"aioconsole",
]

[project.urls]
homepage = "https://github.com/aio-libs/aiomonitor"
documentation = "https://aiomonitor.readthedocs.io"
repository = "https://github.com/aio-libs/aiomonitor"
issues = "https://github.com/aio-libs/aiomonitor/issues"
changelog = "https://github.com/aio-libs/aiomonitor/blob/main/CHANGELOG.md"
chat = "https://matrix.to/#/%23aio-libs:matrix.org"

[tool.setuptools_scm]
# enables setuptools_scm to provide the dynamic version

[tool.black]
line-length = 88

Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ pytest==7.1.2
terminaltables==3.1.10
uvloop==0.17.0
types-requests
build
58 changes: 0 additions & 58 deletions setup.py

This file was deleted.

0 comments on commit 055667c

Please # to comment.