Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ jobs:
run: python -m pylint nmcli
- name: Run unit tests
run: python -m pytest tests
- name: Test build
if: matrix.python-version != '3.7' && matrix.python-version != '3.8' && matrix.python-version != '3.9'
run: python -m build
30 changes: 24 additions & 6 deletions develop-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
pytest==6.2.5
wheel==0.38.1
# Testing
pytest==7.4.4; python_version < "3.10"
pytest==9.0.2; python_version >= "3.10"
pytest-cov==4.1.0; python_version < "3.10"
pytest-cov==7.0.0; python_version >= "3.10"

# Type checking
# Using mypy 0.930 for all versions to avoid no_implicit_optional incompatibility
# Upgrade to mypy 1.x requires code changes for explicit Optional types
mypy==0.930

# Linting
pylint==2.12.2; python_version < "3.10"
pylint==4.0.4; python_version >= "3.10"
twine==3.7.1
autoflake==1.4
autopep8==1.6.0
isort==5.10.1

# Code formatting
autoflake==1.7.8; python_version < "3.10"
autoflake==2.3.1; python_version >= "3.10"
autopep8==1.6.0; python_version < "3.10"
autopep8==2.3.2; python_version >= "3.10"
isort==5.11.5; python_version < "3.10"
isort==7.0.0; python_version >= "3.10"

# Distribution (Python 3.10+ only, per build policy)
wheel==0.45.1; python_version >= "3.10"
twine==6.2.0; python_version >= "3.10"
build==1.3.0; python_version >= "3.10"
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "nmcli"
version = "1.5.0"
description = "A python wrapper library for the network-manager cli client"
readme = "README.md"
authors = [{name = "ushiboy"}]
license = "MIT"
license-files = ["LICENSE.txt"]
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: POSIX :: Linux"
]

[project.urls]
Homepage = "https://github.com/ushiboy/nmcli"

[tool.setuptools.packages.find]
include = ["nmcli*"]

[tool.setuptools.package-data]
nmcli = ["py.typed"]
39 changes: 3 additions & 36 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,6 @@
#!/usr/bin/env python3
# This file is kept for backwards compatibility.
# All configuration is now in pyproject.toml
from setuptools import setup
from setuptools.command.test import test

class PyTest(test):

def run_tests(self):
import pytest
pytest.main(self.test_args)

with open('README.md', 'r') as f:
long_description = f.read()

setup(
name='nmcli',
version='1.5.0',
author='ushiboy',
license='MIT',
license_files = ('LICENSE.txt',),
description='A python wrapper library for the network-manager cli client',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/ushiboy/nmcli',
packages=['nmcli', 'nmcli.data', 'nmcli.dummy'],
package_data={
'nmcli': ['py.typed'],
},
test_suite='tests',
python_requires='>=3.7',
tests_require=[
'pytest'
],
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux'
],
cmdclass={'test': PyTest}
)
setup()