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

merge with master #21

Merged
merged 37 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c60358b
Add support for Python 3.10, drop EOL 3.5 (#952)
hugovk Dec 7, 2021
4c234f6
Remove duplicate entry in pyi stub (#979)
ajnelson-nist Dec 7, 2021
4df5c88
Replace deprecated SafeConfigParser with ConfigParser (#953)
hugovk Dec 15, 2021
c5da357
Designate connection string as optional (#987)
ajnelson-nist Dec 15, 2021
7aaca60
Fix spelling typos (#985)
kianmeng Dec 15, 2021
b1cfb75
Fix for DSN Names with non-ASCII chars (#951)
Dec 16, 2021
7f00778
Added InterfaceError to pyodbc.pyi. (#1013)
bdholder Jan 28, 2022
ba81703
Upgrade deprecated unicode encoding calls (#792)
methane Feb 6, 2022
4a7c583
Do not include .pyc artifacts in source tarball #742
fladi Mar 27, 2022
6c79d7a
Build wheels with cibuildwheels on GitHub Actions
abitrolly Oct 13, 2021
e2409c1
Install unixodbc-dev for Linux wheels
abitrolly Oct 13, 2021
20fdf5f
Enable GitHub Actions for pull requests
abitrolly Oct 13, 2021
597700e
Use Debian based `manylinux_2_24` image
abitrolly Oct 14, 2021
155ef17
`apt-get` update before installing in wheel build
abitrolly Oct 14, 2021
996fce1
Use PEP 440 version name required for wheels
abitrolly Oct 14, 2021
32ee84a
Skip building 32-bit wheels
abitrolly Oct 14, 2021
c88d661
4.0.dev0 for default version, because test_version() wants 3 parts here
abitrolly Oct 14, 2021
1295fa6
Had to use Debian image for PyPy too
abitrolly Oct 14, 2021
feb03dd
Disable PyPy wheels
abitrolly Oct 15, 2021
6aa72e6
Update README.md
jose598 Oct 29, 2021
9b580af
Avoid error when testing with DSN= connection
gordthompson Jan 2, 2022
b7cbf90
Disable setencoding/setdecoding in tests3/pgtests.py
gordthompson Jan 6, 2022
8228dbc
Adjust test_columns() in tests3/pgtests.py for newer driver versions
gordthompson Jan 6, 2022
9d84ef1
Move driver version check out of function
gordthompson Jan 6, 2022
6bae8f0
Add comment to _get_column_size()
gordthompson Jan 12, 2022
e67ad89
Fix memory leak with decimal parameters
gordthompson Feb 14, 2022
04ad11d
Create codeql-analysis.yml
mkleehammer Apr 16, 2022
a4b0b75
Bugfix/sql param data memory leak (#703)
Mizaro May 13, 2022
1f05bb6
Replace deprecated PyUnicode_FromUnicode(NULL, size) calls (#998)
bkline Jan 2, 2022
1b4e214
Making pyodbc compatible with PostgreSQL infinity dates, returning MI…
lsrzj Dec 18, 2021
234efd7
Removing autoformat from code
lsrzj Apr 26, 2022
b069e00
Removing autoformat from code
lsrzj Apr 26, 2022
8519c69
Add odbc_config support on mac and m1 homebrew dir
Aloisius Feb 11, 2021
f28d235
Note EOL of 2.7 support in README (#945)
mkleehammer Jul 14, 2022
b7e944a
Fix version of CI generated wheels
mkleehammer Jul 14, 2022
c717c78
Fix for #1082 libraries in Linux wheels (#1084)
keitherskine Aug 7, 2022
2071e94
use argparse instead of optparse (#1089)
keitherskine Aug 7, 2022
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
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '38 0 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
70 changes: 62 additions & 8 deletions .github/workflows/ubuntu_build.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Ubuntu build

on: [push]
on: [push, pull_request]

jobs:
run_tests:

name: Run tests on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- python-version: 2.7
- python-version: "2.7"
tests-dir: tests2
- python-version: 3.5
- python-version: "3.6"
tests-dir: tests3
- python-version: 3.6
- python-version: "3.7"
tests-dir: tests3
- python-version: 3.7
- python-version: "3.8"
tests-dir: tests3
- python-version: 3.8
- python-version: "3.9"
tests-dir: tests3
- python-version: 3.9
- python-version: "3.10"
tests-dir: tests3

services:
Expand Down Expand Up @@ -191,3 +191,57 @@ jobs:
run: |
cd "$GITHUB_WORKSPACE"
python "./${{ matrix.tests-dir }}/mysqltests.py" "DRIVER={MySQL ODBC 8.0 ANSI Driver};SERVER=localhost;UID=root;PWD=root;DATABASE=test;CHARSET=utf8mb4"

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Build sdist
run: python setup.py sdist

- name: Upload builds
uses: actions/upload-artifact@v3
with:
name: sdist
path: ./dist/*.gz

build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job
os: [windows-2019, macos-11, ubuntu-20.04]

steps:
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/[email protected]
# https://cibuildwheel.readthedocs.io/en/stable/options/#options-summary
env:
# Windows - both 64-bit and 32-bit builds
CIBW_ARCHS_WINDOWS: "AMD64 x86"

# macOS - both Intel and ARM builds; no bundled libraries
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""

# Linux - based on CentOS 7; glibc 64-bit builds only; no bundled libraries
# https://github.com/pypa/manylinux#docker-images
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_ARCHS_LINUX: x86_64
CIBW_BEFORE_ALL_LINUX: yum -y install unixODBC-devel && odbcinst -j
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ""

# Build choices - disable musl Linux and PyPy builds
CIBW_SKIP: "*-musllinux_* pp*"

- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ tags
# The Access unit tests copy empty.accdb and empty.mdb to these names and use them.
test.accdb
test.mdb

2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
global-exclude *.py[cod]

include src/*.h
include src/*.cpp
include tests2/*
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ The easiest way to install is to use pip:

pip install pyodbc

If you are using Mac, you should be using `Homebrew` for installing pyodbc:

brew install unixodbc
pip install pyodbc

Precompiled binary wheels are provided for most Python versions on Windows and macOS. On other
operating systems this will build from source. Note, pyodbc contains C++ extensions so you will
need a suitable C++ compiler on your computer to install pyodbc, for all operating systems. See
Expand All @@ -20,3 +25,6 @@ the [docs](https://github.com/mkleehammer/pyodbc/wiki/Install) for details.
[Documentation](https://github.com/mkleehammer/pyodbc/wiki)

[Release Notes](https://github.com/mkleehammer/pyodbc/releases)

IMPORTANT: Python 2.7 support is being ended. The pyodbc 4.x versions will be the last to
support Python 2.7. The pyodbc 5.x versions will only support Python 3.7 and above.
32 changes: 13 additions & 19 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ environment:
APVYR_GENERATE_WHEELS: "false"
APVYR_VERBOSE: "false"
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# /E:ON and /V:ON options are not enabled in the batch script interpreter
# http://stackoverflow.com/a/13751649/163740
# http://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros#microsoft-specific-predefined-macros
WITH_COMPILER: "cmd /E:ON /V:ON /C .\\appveyor\\compile.cmd"
Expand All @@ -60,26 +60,8 @@ environment:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
PYTHON_HOME: "C:\\Python27-x64"

# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# PYTHON_HOME: "C:\\Python33"

# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# PYTHON_HOME: "C:\\Python33-x64"

# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# PYTHON_HOME: "C:\\Python34"

# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# PYTHON_HOME: "C:\\Python34-x64"

# Python 3.5+ need at least the Visual Studio 2015 image

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_HOME: "C:\\Python35"

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_HOME: "C:\\Python35-x64"

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_HOME: "C:\\Python36"

Expand All @@ -98,6 +80,18 @@ environment:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_HOME: "C:\\Python38-x64"

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_HOME: "C:\\Python39"

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_HOME: "C:\\Python39-x64"

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_HOME: "C:\\Python310"

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_HOME: "C:\\Python310-x64"

cache:
- apvyr_cache -> appveyor\install.ps1

Expand Down
12 changes: 4 additions & 8 deletions appveyor/compile.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,10 @@ IF %PYTHON_MAJOR_VERSION% EQU 2 (
) ELSE (
IF %PYTHON_MAJOR_VERSION% EQU 3 (
SET WINDOWS_SDK_VERSION="v7.1"
IF %PYTHON_MINOR_VERSION% LEQ 4 (
SET SET_SDK_64=Y
) ELSE (
SET SET_SDK_64=N
IF EXIST "%WIN_WDK%" (
:: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/
REN "%WIN_WDK%" 0wdf
)
SET SET_SDK_64=N
IF EXIST "%WIN_WDK%" (
:: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/
REN "%WIN_WDK%" 0wdf
)
) ELSE (
ECHO Unsupported Python version: "%PYTHON_MAJOR_VERSION%"
Expand Down
Loading