miketeo / pysmb

pysmb is an experimental SMB/CIFS library written in Python. It implements the client-side SMB/CIFS protocol (SMB1 and SMB2) which allows your Python application to access and transfer files to/from SMB/CIFS shared folders like your Windows file sharing and Samba folders.
Other
338 stars 95 forks source link

Support python 2 and 3 in single codebase #83

Open dwoz opened 7 years ago

dwoz commented 7 years ago

What's the possibility that we condense down to one codebase that supports both python2 and 3 rather than separate directories?

https://github.com/dwoz/pysmb/tree/master/smb3

miketeo commented 7 years ago

@dwoz: The separation arises from the fact that pysmb has been supporting python 2.5 and below. I think python 2.6 is the first python 2.x to have support for the bytes data type. To be honest, I don't want to antagonize existing pysmb users and risk breaking their scripts when we merge the code base.

If there are others users who are for or against the idea, please feel free to comment here.

dwoz commented 7 years ago

@miketeo Makes sense, I agree it's good to remain backwards compatible. We could try is adding those versions of python to the tox.ini

Circle CI is setup to run the tests and we can all see the test results.

benmoran56 commented 7 years ago

I think you should leave the packages separate. I contribute to some libraries that are dual compatible, and I think this really only works if you are supporting the latest 2.7 and 3.4+ versions. Wanting to support a very legacy version of Python is fine for libraries like this, but it's best if the modern version can eventually take advantage of some fo the newer language features. It can only really do that if it's standalone.

r4ph43l-GitHub commented 6 years ago

I think there are valid arguments for both ways. The additional workload that comes with multi-version support is not worth it and also includes higher risk of breaking code or even worse - applications. Having sources that support all possible versions also make code unreadable and crucial to maintain.

hugovk commented 6 years ago

Python 2.6 and lower, and 3.0 to 3.3 are EOL.

image

They're also little used.

Here's the pip installs for pysmb from PyPI for April 2018:

python_version percent download_count
2.7 70.53% 11,298
3.4 14.92% 2,390
3.6 7.49% 1,200
3.5 6.45% 1,033
2.6 0.59% 94
3.3 0.02% 3
3.7 0.01% 1
Total 16,019

Source: pypinfo --start-date 2018-04-01 --end-date 2018-04-30 --percent --pip --markdown pysmb pyversion

Python 2.7 is EOL on 2020-01-01, and many projects have committed to dropping all Python 2 support on or before that date. See http://python3statement.org/

One option is decide when to drop Python 2.7, and keep both directories until that date, and then just remove the python2 directory entirely.

troyhoffman commented 6 years ago

I agree that they should be separate directories. I also agree that there should be an EOL for Python 2.7 support since Python 2.7 will be EOL in a little over a year. However, I wouldn't delete the directory. There's no reason not to keep it, as long as it's clear that it won't be updated.

ldo commented 3 years ago

All versions of Python 2 are now dead.

hugovk commented 3 years ago

Here's the pip installs for pysmb from PyPI for October 2020 (so far):

category percent downloads
3.6 41.82% 34,610
3.8 19.75% 16,343
3.7 19.22% 15,905
2.7 15.06% 12,462
3.5 2.17% 1,797
null 1.44% 1,194
3.9 0.26% 218
3.4 0.26% 214
3.10 0.01% 7
Total 82,750

Source: pip install -U pypistats && pypistats python_minor pysmb --this-month

A huge drop for Python 2: