Skip to content

Commit

Permalink
merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
v-makouz committed Sep 9, 2022
1 parent 573f147 commit c260542
Show file tree
Hide file tree
Showing 36 changed files with 750 additions and 250 deletions.
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

0 comments on commit c260542

Please sign in to comment.