Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 10, 2025

The PyPI build for version 3.2.0 was missing the api/ and models/ subdirectories, causing import errors like:

ModuleNotFoundError: No module named 'onelogin.api'

Root Cause

The issue was in the pyproject.toml setuptools configuration where the package exclusion pattern was incorrect:

# Before (incorrect)
packages = {find = {exclude = ["tests*", "docs*"]}}

# After (fixed)  
packages = {find = {exclude = ["test*", "docs*"]}}

The pattern was looking for directories starting with "tests" but the actual test directory is named "test" (singular). This caused:

  1. The test directory to be incorrectly included in wheel distributions
  2. Potential inconsistencies in package discovery across different build environments

Solution

Updated the exclude pattern to match the actual directory name. This ensures:

  • onelogin.api package (25 API modules) is included in builds
  • onelogin.models package (161 model files) is included in builds
  • onelogin.saml2 package is included in builds
  • ✅ Test files are properly excluded from wheel distributions
  • ✅ Consistent package discovery across all build environments

Verification

Built and tested both source and wheel distributions:

  • Source distribution correctly includes all packages and test files
  • Wheel distribution includes all required packages but excludes test files
  • Package structure verified with setuptools.find_packages()

Fixes #105.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

… are included in builds

Co-authored-by: Subterrane <5290140+Subterrane@users.noreply.github.com>
Copilot AI changed the title [WIP] Missing subdirectories in build Fix missing subdirectories in PyPI builds by correcting package exclusion pattern Sep 10, 2025
Copilot AI requested a review from Subterrane September 10, 2025 12:44
@Subterrane Subterrane marked this pull request as ready for review September 10, 2025 12:57
@Subterrane Subterrane merged commit 7cb2091 into main Sep 10, 2025
7 checks passed
@Subterrane Subterrane deleted the copilot/fix-105 branch September 10, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing subdirectories in build

2 participants