thombashi / tcconfig

A tc command wrapper. Make it easy to set up traffic control of network bandwidth/latency/packet-loss/packet-corruption/etc. to a network-interface/Docker-container(veth).
https://tcconfig.rtfd.io/
MIT License
792 stars 85 forks source link

SimpleSQLite >= 1.5.0 breaks tcconfig #177

Closed j04n-f closed 11 months ago

j04n-f commented 11 months ago

Describe the bug

SimpleSQLite version is not pinned (floating version): https://github.com/thombashi/tcconfig/blob/e14f9fbdb235e2d6b2748962735dcf3fa1f356f3/requirements/requirements.txt#L9

New versions of the package breaks tcconfig commands. Forcing SimpleSQLite v1.4.0 installation solves the problem.

Expected behavior

tcshow eth0 command should display the network constrains applied to eth0.

To Reproduce

Steps to reproduce the behavior:

  1. pip install tcconfig
  2. pip install SimpleSQLite==1.5.1
  3. tcshow eth0

Additional context

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.6/x64/bin/tcshow", line 5, in <module>
    from tcconfig.tcshow import main
  File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/tcconfig/tcshow.py", line 24, in <module>
    from .parser.shaping_rule import TcShapingRuleParser
  File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/tcconfig/parser/shaping_rule.py", line 21, in <module>
    from ._filter import TcFilterParser
  File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/tcconfig/parser/_filter.py", line 15, in <module>
    from ._model import Filter
  File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/tcconfig/parser/_model.py", line 6, in <module>
    class Filter(Model):
  File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/tcconfig/parser/_model.py", line 7, in Filter
    device = Text(attr_name=Tc.Param.DEVICE, not_null=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Column.__init__() got an unexpected keyword argument 'attr_name'
merinsTDL commented 11 months ago

Reproduced the same issue. Works if pip depencancy gets reverted to 1.4.0. Even tcset -h fails with this static error.

thombashi commented 11 months ago

@joan-mido-qa @merinsTDL Thank you for your report. I have released SimpleSQLite v1.5.2 that restores backward compatibility as a workaround.