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

Fix the package versions in the CI-generated wheels #1121

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/ubuntu_build.yml
Expand Up @@ -230,14 +230,23 @@ jobs:

# 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
CIBW_BEFORE_ALL_LINUX: yum -y install unixODBC-devel && odbcinst -j
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ""
# 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*"
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -46,6 +46,10 @@ x86/
# Executables
*.exe

# Linters
.flake8
.pylintrc

# Other
pyodbc.conf
tmp
Expand All @@ -54,4 +58,3 @@ tags
# The Access unit tests copy empty.accdb and empty.mdb to these names and use them.
test.accdb
test.mdb

1 change: 1 addition & 0 deletions appveyor/test_script.cmd
Expand Up @@ -9,6 +9,7 @@ ECHO *** Available ODBC Drivers:

REM check if any testing should be done at all
IF NOT "%APVYR_RUN_TESTS%" == "true" (
ECHO.
ECHO *** Skipping all the unit tests
GOTO :end
)
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
14 changes: 14 additions & 0 deletions setup.py
Expand Up @@ -19,6 +19,10 @@

OFFICIAL_BUILD = 9999

# This version identifier should refer to the NEXT release, not the
# current one. After each release, the version should be incremented.
VERSION = '4.0.35'


def _print(s):
# Python 2/3 compatibility
Expand Down Expand Up @@ -270,6 +274,16 @@ def get_version():
name = None # branch/feature name. Should be None for official builds.
numbers = None # The 4 integers that make up the version.

# If we are in the CICD pipeline, use the VERSION. There is no tagging information available
# because Github Actions fetches the repo with the options --no-tags and --depth=1.

# CI providers (Github Actions / Travis / CircleCI / AppVeyor / etc.) typically set CI to "true", but
# in cibuildwheel linux containers, the usual CI env vars are not available, only CIBUILDWHEEL.
if os.getenv('CI', 'false').lower() == 'true' or 'CIBUILDWHEEL' in os.environ:
name = VERSION
numbers = [int(p) for p in VERSION.split('.')]
return name, numbers

# If this is a source release the version will have already been assigned and be in the PKG-INFO file.

name, numbers = _get_version_pkginfo()
Expand Down