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

Update test dependencies #93

Merged
merged 7 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.6'
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: [3.11]

steps:
- uses: actions/checkout@v1
Expand Down
27 changes: 0 additions & 27 deletions .scrutinizer.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ All notable changes to the `python-openflow` project are documented in this file
[UNRELEASED] - Under development
********************************

Changed
=======
- Updated python environment installation from 3.9 to 3.11
- Updated test dependencies

[2023.2.0] - 2024-02-16
***********************

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Quick Start
Installing
==========

In order to use this software please install python3.9 into your
In order to use this software please install python3.11 into your
environment beforehand.

We are doing a huge effort to make Kytos and its components available on all
Expand Down
12 changes: 6 additions & 6 deletions pyof/foundation/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@ class MetaStruct(type):

# pylint: disable=unused-argument
@classmethod
def __prepare__(cls, name, bases, **kwargs):
def __prepare__(mcs, name, bases, **kwargs):
return OrderedDict()

def __new__(cls, name, bases, classdict, **kwargs):
def __new__(mcs, name, bases, classdict, **kwargs):
"""Inherit attributes from parent class and update their versions.

Here is the moment that the new class is going to be created. During
Expand Down Expand Up @@ -330,7 +330,7 @@ class and place them as class attributes on the class being created.
curr_version)

if attr_name == 'header':
attr = cls._header_message_type_update(obj, attr)
attr = mcs._header_message_type_update(obj, attr)

inherited_attributes.update([attr])
#: We are going to inherit just from the 'closest parent'
Expand All @@ -350,7 +350,7 @@ class and place them as class attributes on the class being created.
inherited_attributes.update(classdict)
classdict = inherited_attributes

return super().__new__(cls, name, bases, classdict, **kwargs)
return super().__new__(mcs, name, bases, classdict, **kwargs)

@staticmethod
def _header_message_type_update(obj, attr):
Expand Down Expand Up @@ -864,7 +864,7 @@ class MetaBitMask(type):
access object.ELEMENT and recover either values or names).
"""

def __new__(cls, name, bases, classdict):
def __new__(mcs, name, bases, classdict):
"""Convert class attributes into enum elements."""
_enum = OrderedDict([(key, value) for key, value in classdict.items()
if key[0] != '_' and not
Expand All @@ -875,7 +875,7 @@ def __new__(cls, name, bases, classdict):
if key[0] == '_' or hasattr(value, '__call__') or
isinstance(value, property)}
classdict['_enum'] = _enum
return type.__new__(cls, name, bases, classdict)
return type.__new__(mcs, name, bases, classdict)

def __getattr__(cls, name):
return cls._enum[name]
Expand Down
1 change: 1 addition & 0 deletions pyof/foundation/basic_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ def unpack(self, buff, offset=0):
end = begin + self.length
unpacked_data = struct.unpack(self._fmt, buff[begin:end])[0]
except struct.error:
# pylint: disable=broad-exception-raised
raise Exception("%s: %s" % (offset, buff))

self._value = unpacked_data.decode('ascii').rstrip('\0')
Expand Down
2 changes: 1 addition & 1 deletion pyof/v0x01/common/flow_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class FlowWildCards(GenericBitMask):
OFPFW_NW_TOS = 1 << 21

#: Wildcard all fields.
OFPFW_ALL = ((1 << 22) - 1)
OFPFW_ALL = (1 << 22) - 1


# Classes
Expand Down
94 changes: 37 additions & 57 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,125 +1,123 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --output-file=requirements/dev.txt --resolver=backtracking requirements/dev.in
# pip-compile --output-file=requirements/dev.txt requirements/dev.in
#
-e git+https://github.com/kytos/sphinx-theme.git#egg=kytos-sphinx-theme
# via -r requirements/dev.in
-e .
# via -r requirements/dev.in
alabaster==0.7.13
# via sphinx
astroid==2.13.5
astroid==3.1.0
# via pylint
attrs==23.1.0
# via pytest
babel==2.12.1
# via sphinx
black==23.3.0
black==24.2.0
# via python-openflow
build==0.10.0
# via pip-tools
certifi==2022.12.7
cachetools==5.3.3
# via tox
certifi==2024.2.2
# via requests
charset-normalizer==3.1.0
chardet==5.2.0
# via tox
charset-normalizer==3.3.2
# via requests
click==8.1.3
click==8.1.7
# via
# black
# pip-tools
colorama==0.4.6
# via sphinx-autobuild
# via
# sphinx-autobuild
# tox
coverage[toml]==7.2.5
# via pytest-cov
dill==0.3.6
# via pylint
distlib==0.3.6
distlib==0.3.8
# via virtualenv
docopt==0.6.2
# via yala
docutils==0.19
# via sphinx
exceptiongroup==1.1.1
# via pytest
filelock==3.12.0
filelock==3.13.1
# via
# tox
# virtualenv
idna==3.4
idna==3.6
# via requests
imagesize==1.4.1
# via sphinx
importlib-metadata==6.6.0
# via sphinx
iniconfig==2.0.0
# via pytest
isort==5.12.0
isort==5.13.2
# via
# pylint
# python-openflow
# yala
jinja2==3.1.2
jinja2==3.1.3
# via sphinx
lazy-object-proxy==1.9.0
# via astroid
livereload==2.6.3
# via sphinx-autobuild
markupsafe==2.1.2
markupsafe==2.1.5
# via jinja2
mccabe==0.7.0
# via pylint
mypy-extensions==1.0.0
# via black
packaging==23.1
packaging==23.2
# via
# black
# build
# pyproject-api
# pytest
# sphinx
# tox
pathspec==0.11.1
# via black
pip-tools==6.13.0
# via python-openflow
platformdirs==3.5.0
platformdirs==4.2.0
# via
# black
# pylint
# tox
# virtualenv
pluggy==1.0.0
pluggy==1.4.0
# via
# pytest
# tox
py==1.11.0
# via tox
pycodestyle==2.10.0
pycodestyle==2.11.1
# via
# python-openflow
# yala
pygments==2.15.1
# via sphinx
pylint==2.15.0
pylint==3.1.0
# via
# python-openflow
# yala
pyproject-api==1.6.1
# via tox
pyproject-hooks==1.0.0
# via build
pytest==7.2.1
pytest==8.0.1
# via
# pytest-asyncio
# pytest-cov
# python-openflow
pytest-asyncio==0.20.3
pytest-asyncio==0.23.5
# via python-openflow
pytest-cov==4.0.0
pytest-cov==4.1.0
# via python-openflow
requests==2.29.0
requests==2.31.0
# via sphinx
six==1.16.0
# via
# livereload
# tox
# via livereload
snowballstemmer==2.2.0
# via sphinx
sphinx==7.0.0
Expand All @@ -140,40 +138,22 @@ sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
tomli==2.0.1
# via
# black
# build
# coverage
# pylint
# pyproject-hooks
# pytest
# tox
tomlkit==0.11.8
# via pylint
tornado==6.3.1
# via livereload
tox==3.28.0
tox==4.13.0
# via python-openflow
typing-extensions==4.5.0
# via
# astroid
# black
# pylint
urllib3==1.26.15
urllib3==1.26.18
# via requests
virtualenv==20.21.0
virtualenv==20.25.1
# via
# python-openflow
# tox
wheel==0.40.0
# via pip-tools
wrapt==1.15.0
# via astroid
yala==3.2.0
# via python-openflow
zipp==3.15.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
28 changes: 12 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# Disabling checks due to https://github.com/PyCQA/pylint/issues/73
# pylint: disable=import-error,no-name-in-module,unspecified-encoding
# pylint: disable=consider-using-with
from distutils.command.clean import clean
# pylint: enable=import-error,no-name-in-module
from subprocess import CalledProcessError, call, check_call

Expand Down Expand Up @@ -69,17 +68,14 @@ def finalize_options(self):
pass


class Cleaner(clean):
class Cleaner(SimpleCommand):
"""Custom clean command to tidy up the project root."""

description = 'clean build, dist, pyc and egg from package and docs'

def run(self):
"""Clean build, dist, pyc and egg from package and docs."""
super().run()
call('rm -vrf ./build ./dist ./*.pyc ./*.egg-info', shell=True)
call('find . -name __pycache__ -type d | xargs rm -rf', shell=True)
call('test -d docs && make -C docs/ clean', shell=True)
call('make clean', shell=True)


class Test(TestCommand):
Expand Down Expand Up @@ -153,16 +149,16 @@ def run(self):
include_package_data=True,
extras_require={'dev': [
'pip-tools >= 2.0',
'pytest==7.2.1',
'pytest-cov==4.0.0',
'pytest-asyncio==0.20.3',
'black==23.3.0',
'isort==5.12.0',
'pylint==2.15.0',
'pycodestyle==2.10.0',
'pytest==8.0.1',
'pytest-cov==4.1.0',
'pytest-asyncio==0.23.5',
'black==24.2.0',
'isort==5.13.2',
'pylint==3.1.0',
'pycodestyle==2.11.1',
'yala==3.2.0',
'tox==3.28.0',
'virtualenv==20.21.0'
'tox==4.13.0',
'virtualenv==20.25.1',
]},
packages=find_packages(exclude=['tests']),
cmdclass={
Expand All @@ -176,7 +172,7 @@ def run(self):
classifiers=[
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.11',
'Topic :: System :: Networking',
'Topic :: Software Development :: Libraries'
])
Loading
Loading