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

Python 2.7 backport #2

Open
britram opened this issue Jun 28, 2013 · 10 comments
Open

Python 2.7 backport #2

britram opened this issue Jun 28, 2013 · 10 comments

Comments

@britram
Copy link
Owner

britram commented Jun 28, 2013

coordinate with / investigate joelparker fork to backport to 2.7

@rouge8
Copy link

rouge8 commented Oct 25, 2013

I started some work on this (working with @janies), but the lack of test coverage and my unfamiliarity with ipfix makes me worry I'll break something.

Name             Stmts   Miss  Cover   Missing
----------------------------------------------
ipfix/__init__       9      0   100%
ipfix/ie           112     15    87%   100, 115, 163, 166, 169, 172, 184, 187, 233, 245, 269, 287-288, 291, 321
ipfix/ieutils       36     28    22%   29-52, 56-63, 67-70
ipfix/message      218     53    76%   194, 255, 266-269, 288, 305-334, 352, 359, 363, 408, 411, 420-422, 500, 518, 530-533, 556, 589, 613, 619, 652-655, 678, 684-689, 715-717, 721-722
ipfix/reader        25     18    28%   42-44, 54-60, 71-77, 87
ipfix/template     188     32    83%   35-36, 89, 102, 114, 196-197, 213, 258, 282-286, 302, 307-312, 315-324, 337-341, 379
ipfix/types        126     23    82%   202, 205, 225-235, 271-274, 277-280, 349, 363-364, 371-372, 378-381
ipfix/v9pdu        138    107    22%   52-70, 73, 77-78, 81-90, 118-154, 165, 177-178, 181-185, 198-207, 215-217, 232-265, 275, 280, 283-298, 301-317
ipfix/writer        36     25    31%   40-43, 46-50, 63-65, 75, 87-88, 101-103, 107-109, 122-126, 138
----------------------------------------------
TOTAL              888    301    66%

Do you have any scripts or data you use for testing other than the doctests?

@britram
Copy link
Owner Author

britram commented Oct 26, 2013

The only testing at this point is the doctest stuff, and a few scripts
which use this (mainly for reading) in qof/pytools. Better coverage
would be nice (should open a separate issue for it); lack of it is one
of the reasons the release number is 0.9.x.

On the other hand, since nobody's using this on 2.7 anyway, I wouldn't
worry about breaking anything in a 2.7 branch. :)

The main issues with porting back will be modules that aren't there
(ipaddress being the one I know of off the top of my head) and handling
iterator constructs that don't exist in 2.7 (biggest example is yield
from, though you can do the same thing more awkwardly without it).

For exercising reading better than the test coverage provides, ensuring
ipfix2csv provides identical results for a reasonably complex input
(i.e. YAF output) on both branches is a pretty good start.

Andy Freeland wrote:

I started some work on this (working with @janies
https://github.com/janies), but the lack of test coverage and my
unfamiliarity with ipfix makes me worry I'll break something.

Name Stmts Miss Cover Missing

ipfix/init 9 0 100%
ipfix/ie 112 15 87% 100, 115, 163, 166, 169, 172, 184, 187, 233, 245, 269, 287-288, 291, 321
ipfix/ieutils 36 28 22% 29-52, 56-63, 67-70
ipfix/message 218 53 76% 194, 255, 266-269, 288, 305-334, 352, 359, 363, 408, 411, 420-422, 500, 518, 530-533, 556, 589, 613, 619, 652-655, 678, 684-689, 715-717, 721-722
ipfix/reader 25 18 28% 42-44, 54-60, 71-77, 87
ipfix/template 188 32 83% 35-36, 89, 102, 114, 196-197, 213, 258, 282-286, 302, 307-312, 315-324, 337-341, 379
ipfix/types 126 23 82% 202, 205, 225-235, 271-274, 277-280, 349, 363-364, 371-372, 378-381
ipfix/v9pdu 138 107 22% 52-70, 73, 77-78, 81-90, 118-154, 165, 177-178, 181-185, 198-207, 215-217, 232-265, 275, 280, 283-298, 301-317

ipfix/writer 36 25 31% 40-43, 46-50, 63-65, 75, 87-88, 101-103, 107-109, 122-126, 138

TOTAL 888 301 66%
|

Do you have any scripts or data you use for testing other than the doctests?


Reply to this email directly or view it on GitHub
#2 (comment).

@rouge8
Copy link

rouge8 commented Oct 26, 2013

The main issues with porting back will be modules that aren't there
(ipaddress being the one I know of off the top of my head) and handling
iterator constructs that don't exist in 2.7 (biggest example is yield
from, though you can do the same thing more awkwardly without it).

Yeah, I found backports or alternatives for most of the 3.3+ features, but yield from will become more awkward.

@brettdh
Copy link
Contributor

brettdh commented Sep 26, 2014

Is this backport still likely to happen, or is it abandoned? The fork appears about a year (and a hundred-plus commits) out of date.

@britram
Copy link
Owner Author

britram commented Sep 26, 2014

So the intention is still to do this, but it'll clearly have to start over
with a new branch. Unfortunately the 2.7 backport is pretty far down my
prio list at the moment, so I wouldn't expect to be able to devote any
effort before 2015.

On Fri, Sep 26, 2014 at 2:40 PM, Brett Higgins notifications@github.com
wrote:

Is this backport still likely to happen, or is it abandoned? The fork
appears about a year (and a hundred-plus commits) out of date.


Reply to this email directly or view it on GitHub
#2 (comment).

@brettdh
Copy link
Contributor

brettdh commented Oct 7, 2014

Any wild/ballpark estimate on the amount of effort required? I might be interested in contributing, especially if the test coverage has improved in the past year.

@britram
Copy link
Owner Author

britram commented Sep 7, 2017

@brettdh thanks for #16, will look into merging for 0.9.8...

@britram
Copy link
Owner Author

britram commented Sep 7, 2017

in develop-merge-27, need to verify a couple of things with the tests, will revisit this roll a 0.9.8 next week.

thanks and apologies for the short delay in merging... :)

@jklahn
Copy link

jklahn commented Dec 11, 2017

Python 2.7.14
ipfix 0.9.7

Steps to reproduce:

pip install functools32
pip install py2-ipaddress
pip install pytz
pip install ipfix

- Attempt to import ipfix produces and import error:
[root@91888e677db3 tests]# python
Python 2.7.14 (default, Sep 28 2017, 16:40:48) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipfix
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/ipfix/__init__.py", line 54, in <module>
    from . import types
  File "/usr/local/lib/python2.7/site-packages/ipfix/types.py", line 148, in <module>
    from datetime import datetime, timedelta, timezone
ImportError: cannot import name timezone

Note: Python 2.7 datetime library does not include a timezone module

[root@91888e677db3 tests]# python
Python 2.7.14 (default, Sep 28 2017, 16:40:48) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from dateime import timezone
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named dateime

@JackSunshine
Copy link

Hi, I'd like to know Is any update about this?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants