Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,16 @@ apt-get install -y libltdl7
# For RHEL
dnf install -y libtool-ltdl

# For SUSE/openSUSE
zypper install -y libltdl7

pip install mssql-python
```

## Key Features
### Supported Platforms

Windows, MacOS and Linux (manylinux - Debian, Ubuntu, RHEL & musllinux - Alpine)

> **Note:**
> Support for additional Linux OSs (SUSE Linux) will come soon
>
Windows, MacOS and Linux (manylinux - Debian, Ubuntu, RHEL, SUSE & musllinux - Alpine)

### DBAPI v2.0 Compliance

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
24 changes: 23 additions & 1 deletion mssql_python/pybind/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ mssql_python/
│ ├── debian_ubuntu/
│ │ ├── x86_64/lib/
│ │ └── arm64/lib/
│ └── rhel/
│ ├── rhel/
│ │ ├── x86_64/lib/
│ │ └── arm64/lib/
│ ├── suse/
│ │ ├── x86_64/lib/
│ │ └── arm64/lib/
│ └── alpine/
│ ├── x86_64/lib/
│ └── arm64/lib/
└── ddbc_bindings.cp{python_version}-{architecture}.{extension}
Expand Down Expand Up @@ -152,6 +158,22 @@ Linux builds support multiple distributions:
- `libmsodbcsql-18.5.so.1.1` - Main driver
- `libodbcinst.so.2` - Installer library

**SUSE/openSUSE x86_64:**
- `libmsodbcsql-18.5.so.1.1` - Main driver
- `libodbcinst.so.2` - Installer library

**SUSE/openSUSE ARM64:**
- `libmsodbcsql-18.5.so.1.1` - Main driver
- `libodbcinst.so.2` - Installer library

**Alpine x86_64:**
- `libmsodbcsql-18.5.so.1.1` - Main driver
- `libodbcinst.so.2` - Installer library

**Alpine ARM64:**
- `libmsodbcsql-18.5.so.1.1` - Main driver
- `libodbcinst.so.2` - Installer library

## **Python Extension Modules**
Your build system generates architecture-specific Python extension modules:

Expand Down
4 changes: 3 additions & 1 deletion mssql_python/pybind/ddbc_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,10 @@ std::string GetDriverPathCpp(const std::string& moduleDir) {
platform = "alpine";
} else if (fs::exists("/etc/redhat-release") || fs::exists("/etc/centos-release")) {
platform = "rhel";
} else if (fs::exists("/etc/SuSE-release") || fs::exists("/etc/SUSE-brand")) {
platform = "suse";
} else {
platform = "debian_ubuntu";
platform = "debian_ubuntu"; // Default to debian_ubuntu for other distros
}

fs::path driverPath = basePath / "libs" / "linux" / platform / arch / "lib" / "libmsodbcsql-18.5.so.1.1";
Expand Down
8 changes: 6 additions & 2 deletions tests/test_000_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ def _normalize_architecture(self):

def _detect_linux_distro(self):
"""Detect Linux distribution for driver path selection."""
distro_name = "debian_ubuntu" # default
distro_name = "ubuntu" # default
'''
#ifdef __linux__
if (fs::exists("/etc/alpine-release")) {
platform = "alpine";
} else if (fs::exists("/etc/redhat-release") || fs::exists("/etc/centos-release")) {
platform = "rhel";
} else if (fs::exists("/etc/SuSE-release") || fs::exists("/etc/SUSE-brand")) {
platform = "suse";
} else {
platform = "ubuntu";
}
Expand All @@ -77,8 +79,10 @@ def _detect_linux_distro(self):
distro_name = "alpine"
elif (Path("/etc/redhat-release").exists() or Path("/etc/centos-release").exists()):
distro_name = "rhel"
elif (Path("/etc/SuSE-release").exists() or Path("/etc/SUSE-brand").exists()):
distro_name = "suse"
else:
distro_name = "debian_ubuntu"
distro_name = "ubuntu" # Default for other Linux distributions
except Exception:
pass # use default

Expand Down
Loading