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

Add support for Python 3.10, drop EOL 3.5 #952

Merged
merged 5 commits into from
Dec 7, 2021

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Sep 12, 2021

Fixes #954.

Python 3.10.0 final is due for release in October:

The final release candidate is now out and the Python release team has issued a call to action for community members:

We strongly encourage maintainers of third-party Python projects to prepare their projects for 3.10 compatibilities during this phase. As always, report any issues to the Python bug tracker.

https://discuss.python.org/t/python-3-10-0rc2-is-now-available/10496?u=hugovk

So let's also test and add support for 3.10.

Drops support for EOL Python 3.5.

@keitherskine
Copy link
Collaborator

@hugovk Many thanks for this PR, but could you update setup.py to reflect the addition of Python 3.9 and 3.10?

Also, the build tests are failing for Python 3.5. Rather than fix the unit tests, it seems easiest to add #954 into this PR. If you're OK with that, go ahead and comment out the relevant Python 3.5 tests in appveyor.yml, and ubuntu_build.yml, add Python 3.9 tests to appveyor.yml (3.10 is not available there), and remove the reference to Python 3.5 in setup.py. Then the build tests for both Windows and Ubuntu should pass. Many thanks!

@hugovk
Copy link
Contributor Author

hugovk commented Sep 14, 2021

@hugovk Many thanks for this PR, but could you update setup.py to reflect the addition of Python 3.9 and 3.10?

I already added the 3.9 and 3.10 classifiers to setup.py 👍

Also, the build tests are failing for Python 3.5. Rather than fix the unit tests, it seems easiest to add #954 into this PR. If you're OK with that, go ahead and comment out the relevant Python 3.5 tests in appveyor.yml, and ubuntu_build.yml, add Python 3.9 tests to appveyor.yml (3.10 is not available there), and remove the reference to Python 3.5 in setup.py. Then the build tests for both Windows and Ubuntu should pass. Many thanks!

Good idea, removed 3.5!

I also added python_requires to setup.py, so pip knows which package version to install for end users.


Whilst we're at it, how about also dropping 2.7? It's been EOL for nearly two years and is little used. Dropping would further reduce the maintenance burden and allow modern features of Python to be used.

Here's the pip installs for pyodbc from PyPI for August 2021:

category percent downloads
3.7 71.38% 8,562,696
3.8 15.27% 1,831,650
3.6 6.20% 743,452
2.7 3.02% 362,048
3.5 2.73% 327,753
3.9 0.91% 109,209
null 0.49% 59,002
3.4 0.00% 576
3.10 0.00% 330
3.3 0.00% 3
2.6 0.00% 1
Total 11,996,720

Source: pip install -U pypistats && pypistats python_minor pyodbc --last-month

@hugovk hugovk changed the title Add support for Python 3.10 Add support for Python 3.10, drop EOL 3.5 Sep 14, 2021
@hugovk
Copy link
Contributor Author

hugovk commented Oct 5, 2021

Updated now Python 3.10 final is out.

https://discuss.python.org/t/python-3-10-0-is-now-available/10955

@abitrolly
Copy link
Contributor

This is needed to fix broken builds now.

@keitherskine
Copy link
Collaborator

@hugovk AppVeyor have at last added Python 3.10 to their Windows VS2019 build. In which case, it would be great if you could add Python 3.10 to the pyodbc appveyor.yml, if you get a chance. Many thanks!

For ref: https://www.appveyor.com/docs/windows-images-software/#python

setup.py Show resolved Hide resolved
@hugovk
Copy link
Contributor Author

hugovk commented Nov 3, 2021

@hugovk AppVeyor have at last added Python 3.10 to their Windows VS2019 build. In which case, it would be great if you could add Python 3.10 to the pyodbc appveyor.yml, if you get a chance. Many thanks!

For ref: appveyor.com/docs/windows-images-software/#python

Done!

@gordthompson gordthompson self-requested a review November 5, 2021 13:40
Copy link
Collaborator

@gordthompson gordthompson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Would be nice to get CI working again.

@keitherskine keitherskine merged commit c60358b into mkleehammer:master Dec 7, 2021
@hugovk hugovk deleted the add-3.10 branch December 7, 2021 06:50
@hugovk
Copy link
Contributor Author

hugovk commented Dec 7, 2021

By the way, Python 3.6 is EOL in a couple of weeks :)

https://endoflife.date/python

v-makouz pushed a commit to v-makouz/pyodbc that referenced this pull request Sep 9, 2022
* Add support for Python 3.10, drop EOL 3.5 (mkleehammer#952)

* Remove duplicate entry in pyi stub (mkleehammer#979)

* Replace deprecated SafeConfigParser with ConfigParser (mkleehammer#953)

* Designate connection string as optional (mkleehammer#987)

* Fix spelling typos (mkleehammer#985)

Co-authored-by: Gord Thompson <[email protected]>

* Fix for DSN Names with non-ASCII chars (mkleehammer#951)

* Fix for DSN Names with non-ASCII chars

Fixes: mkleehammer#948

Co-authored-by: bamboo <[email protected]>
Co-authored-by: Gord Thompson <[email protected]>

* Added InterfaceError to pyodbc.pyi. (mkleehammer#1013)

Co-authored-by: Benjamin Holder <[email protected]>

* Upgrade deprecated unicode encoding calls (mkleehammer#792)

* Do not include .pyc artifacts in source tarball mkleehammer#742

* Build wheels with cibuildwheels on GitHub Actions

Fixes mkleehammer#175
Ref mkleehammer#688
Closes mkleehammer#668
Closes mkleehammer#685
Fixes mkleehammer#441 and pretty much most issues that mention
` sql.h: No such file or directory`

This also need to setup some PyPI keys for automated uploads.

* Install unixodbc-dev for Linux wheels

* Enable GitHub Actions for pull requests

* Use Debian based `manylinux_2_24` image

* `apt-get` update before installing in wheel build

* Use PEP 440 version name required for wheels

* Skip building 32-bit wheels

* 4.0.dev0 for default version, because test_version() wants 3 parts here

Checked this won't shadow released minor version (credit goes to @hugovk)

    >>> from packaging.version import Version
    >>> Version("4.0.dev0") > Version("4.0.24")
    False

* Had to use Debian image for PyPy too

* Disable PyPy wheels

https://cibuildwheel.readthedocs.io/en/stable/options/#build-selection

PyPy is missing some C functions that `pyodbc` needs.

* Update README.md

* Avoid error when testing with DSN= connection

Fixes: mkleehammer#1000

* Disable setencoding/setdecoding in tests3/pgtests.py

Fixes: mkleehammer#1004

* Adjust test_columns() in tests3/pgtests.py for newer driver versions

Fixes: mkleehammer#1003

* Move driver version check out of function

* Add comment to _get_column_size()

* Fix memory leak with decimal parameters

Fixes: mkleehammer#1026

* Create codeql-analysis.yml

* Bugfix/sql param data memory leak (mkleehammer#703)

* Updated .gitignore

* * Created a test file for the specific scenario

* * Updated doc of test file for the specific SQLParamData scenario

* * Fixed the test file for the specific SQLParamData scenario by Py_XDECREF the PyObject with 1 reference.

* * Improved the test to close the cursor and set it to None, then forcing the gc

* * Changed the fix of the memory leak and updated the test.

* * Removed redundant empty line

* * Converted tabs to spaces

* * Moved variable out of conn's scope

* Update gitignore, remove duplicated

* Replace deprecated PyUnicode_FromUnicode(NULL, size) calls (mkleehammer#998)

Current versions of Python write a deprecation warning message to
stderr, which breaks CGI scripts running under web servers which
fold stderr into stdout. Likely breaks other software. This change
replaces the deprecated calls with PyUnicode_New(size, maxchar).
The accompanying code to populate the new objects has also been
rewritten to use the new PyUnicode APIs.

* Making pyodbc compatible with PostgreSQL infinity dates, returning MINYEAR and MAXYEAR to python, instead of values out of python's limits

* Removing autoformat from code

* Removing autoformat from code

* Add odbc_config support on mac and m1 homebrew dir

* Note EOL of 2.7 support in README (mkleehammer#945)

* Fix version of CI generated wheels

The CI system is checking out exact tags like "git checkout 4.0.33", which results in a
detached HEAD.  The version calculation was adding the commit hash.

* Fix for mkleehammer#1082 libraries in Linux wheels (mkleehammer#1084)

* use argparse instead of optparse (mkleehammer#1089)

Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Alex Nelson <[email protected]>
Co-authored-by: Kian Meng, Ang <[email protected]>
Co-authored-by: Gord Thompson <[email protected]>
Co-authored-by: bamboo <[email protected]>
Co-authored-by: Gord Thompson <[email protected]>
Co-authored-by: bdholder <[email protected]>
Co-authored-by: Benjamin Holder <[email protected]>
Co-authored-by: Inada Naoki <[email protected]>
Co-authored-by: Michael Fladischer <[email protected]>
Co-authored-by: Anatoli Babenia <[email protected]>
Co-authored-by: Francisco Morales <[email protected]>
Co-authored-by: Gord Thompson <[email protected]>
Co-authored-by: Michael Kleehammer <[email protected]>
Co-authored-by: Gilad Leifman <[email protected]>
Co-authored-by: Bob Kline <[email protected]>
Co-authored-by: Leandro Scott <[email protected]>
Co-authored-by: Jordan Mendelson <[email protected]>
Co-authored-by: Keith Erskine <[email protected]>
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

Successfully merging this pull request may close these issues.

Drop official support for Python 3.5
4 participants