-
Notifications
You must be signed in to change notification settings - Fork 562
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into fetchdictarray
- Loading branch information
Showing
32 changed files
with
1,669 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Build all the artifacts for a release (i.e. the source distribution file and the various wheels) | ||
|
||
name: Build the release artifacts | ||
|
||
# include "workflow_dispatch" so this workflow can be run manually from the Actions portal | ||
on: [workflow_dispatch] | ||
|
||
jobs: | ||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip build | ||
- name: Build sdist | ||
run: python -m build --sdist --no-isolation | ||
|
||
- name: Upload sdist | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: sdist_${{ github.sha }} | ||
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: Set up QEMU | ||
# QEMU is needed for Linux aarch64 wheels | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: all | ||
|
||
- 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" | ||
# prevent the addition of unixODBC dylibs to the wheel by simply not calling the repair | ||
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 aarch64 | ||
# this installs unixODBC 2.3.1 which is quite old but it has the latest ABI so should be fine | ||
CIBW_BEFORE_ALL_LINUX: yum -y install unixODBC-devel | ||
# the raw wheel filename is not PyPi compliant so the wheel must be repaired but | ||
# suppress the addition of unixODBC libs to the wheel with --exclude's | ||
CIBW_REPAIR_WHEEL_COMMAND_LINUX: | ||
auditwheel repair | ||
--exclude libodbc.so.2 | ||
--exclude libltdl.so.7 | ||
--wheel-dir {dest_dir} | ||
{wheel} | ||
|
||
# Build choices - disable musl Linux and PyPy builds | ||
CIBW_SKIP: "*-musllinux_* pp*" | ||
|
||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels_${{ github.sha }} | ||
path: ./wheelhouse/*.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ on: [push, pull_request] | |
|
||
jobs: | ||
run_tests: | ||
|
||
runs-on: ubuntu-latest | ||
name: Run tests on Python ${{ matrix.python-version }} | ||
runs-on: ubuntu-20.04 | ||
|
||
strategy: | ||
fail-fast: false | ||
|
@@ -23,6 +23,8 @@ jobs: | |
tests-dir: tests3 | ||
- python-version: "3.10" | ||
tests-dir: tests3 | ||
- python-version: "3.11" | ||
tests-dir: tests3 | ||
|
||
services: | ||
|
||
|
@@ -72,6 +74,13 @@ jobs: | |
echo "*** cat /etc/odbc.ini" | ||
cat /etc/odbc.ini | ||
- name: Install ODBC driver for SQL Server | ||
run: | | ||
echo "*** apt-get install the driver" | ||
sudo ACCEPT_EULA=Y apt-get install --yes msodbcsql18 | ||
echo '*** ls -l /usr/lib/x86_64-linux-gnu/odbc' | ||
ls -l /opt/microsoft/msodbcsql18/lib64 || true | ||
- name: Install ODBC driver for PostgreSQL | ||
run: | | ||
echo "*** apt-get install the driver" | ||
|
@@ -113,6 +122,8 @@ jobs: | |
cat /etc/odbc.ini | ||
echo '*** ls -l /opt/microsoft/msodbcsql17/lib64' | ||
ls -l /opt/microsoft/msodbcsql17/lib64 || true | ||
echo '*** ls -l /opt/microsoft/msodbcsql18/lib64' | ||
ls -l /opt/microsoft/msodbcsql18/lib64 || true | ||
echo '*** ls -l /usr/lib/x86_64-linux-gnu/odbc' | ||
ls -l /usr/lib/x86_64-linux-gnu/odbc || true | ||
|
@@ -147,10 +158,10 @@ jobs: | |
echo "*** create database" | ||
mysql --user=root --password=root --execute "CREATE DATABASE test" | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
|
@@ -165,12 +176,14 @@ jobs: | |
cd "$GITHUB_WORKSPACE" | ||
echo "*** current python version" | ||
python -VV | ||
echo "*** run setup.py" | ||
python setup.py install | ||
echo "*** pip install" | ||
python -m pip install . | ||
echo "*** pip freeze" | ||
python -m pip freeze --all | ||
echo "*** pyodbc version" | ||
python -c "import pyodbc; print(pyodbc.version)" | ||
echo "*** pyodbc drivers" | ||
python -c "import pyodbc; print('\n'.join(sorted(pyodbc.drivers())))" | ||
- name: Run SQL Server 2017 tests | ||
run: | | ||
|
@@ -180,7 +193,7 @@ jobs: | |
- name: Run SQL Server 2019 tests | ||
run: | | ||
cd "$GITHUB_WORKSPACE" | ||
python "./${{ matrix.tests-dir }}/sqlservertests.py" "DRIVER={ODBC Driver 17 for SQL Server};SERVER=localhost,1402;UID=sa;PWD=StrongPassword2019;DATABASE=test" | ||
python "./${{ matrix.tests-dir }}/sqlservertests.py" "DRIVER={ODBC Driver 18 for SQL Server};SERVER=localhost,1402;UID=sa;PWD=StrongPassword2019;DATABASE=test;Encrypt=Optional" | ||
- name: Run PostgreSQL tests | ||
run: | | ||
|
@@ -191,25 +204,3 @@ 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_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2019, macos-10.15] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 | ||
CIBW_BEFORE_ALL_LINUX: apt-get update && apt-get -y install unixodbc-dev | ||
# disable 32-bit and pypy builds | ||
CIBW_SKIP: "*-win32 *-manylinux_i686 pp*" | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./wheelhouse/*.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,36 @@ | ||
# pyodbc | ||
|
||
[![Windows Status](https://ci.appveyor.com/api/projects/status/github/mkleehammer/pyodbc?branch=master&svg=true&passingText=Windows%20build)](https://ci.appveyor.com/project/mkleehammer/pyodbc) | ||
[![Ubuntu build](https://github.com/mkleehammer/pyodbc/actions/workflows/ubuntu_build.yml/badge.svg)](https://github.com/mkleehammer/pyodbc/actions/workflows/ubuntu_build.yml) | ||
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/mkleehammer/pyodbc?branch=master&svg=true&passingText=Windows%20build&failingText=Windows%20build)](https://ci.appveyor.com/project/mkleehammer/pyodbc) | ||
[![Github Actions - Ubuntu Build](https://github.com/mkleehammer/pyodbc/actions/workflows/ubuntu_build.yml/badge.svg?branch=master)](https://github.com/mkleehammer/pyodbc/actions/workflows/ubuntu_build.yml) | ||
[![PyPI](https://img.shields.io/pypi/v/pyodbc?color=brightgreen)](https://pypi.org/project/pyodbc/) | ||
|
||
pyodbc is an open source Python module that makes accessing ODBC databases simple. It | ||
implements the [DB API 2.0](https://www.python.org/dev/peps/pep-0249) specification but is | ||
packed with even more Pythonic convenience. | ||
|
||
The easiest way to install is to use pip: | ||
The easiest way to install pyodbc is to use pip: | ||
|
||
pip install pyodbc | ||
|
||
If you are using Mac, you should be using `Homebrew` for installing pyodbc: | ||
On Macs, you should probably install unixODBC first if you don't already have an ODBC | ||
driver manager installed, e.g. using `Homebrew`: | ||
|
||
```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 | ||
the [docs](https://github.com/mkleehammer/pyodbc/wiki/Install) for details. | ||
brew install unixodbc | ||
pip install pyodbc | ||
|
||
Similarly, on Unix you should make sure you have an ODBC driver manager installed before | ||
installing pyodbc. See the [docs](https://github.com/mkleehammer/pyodbc/wiki/Install) | ||
for more information about how to do this on different Unix flavors. (On Windows, the | ||
ODBC driver manager is built-in.) | ||
|
||
Precompiled binary wheels are provided for multiple Python versions on most Windows, macOS, | ||
and Linux platforms. On other platforms pyodbc will be built from the source code. Note, | ||
pyodbc contains C++ extensions so when building from source you will need a suitable C++ | ||
compiler. See 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 support only Python 3.7 and above. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.