Skip to content

Dependency on flatdict Breaks some builds #496

Closed

Description

@the-real-mathew-moon

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
    Before submitting a bug report, we ask that you first search existing issues and pull requests to see if someone else may have experienced the same issue or may have already submitted a fix for it.

Python Version & Okta SDK Version(s)

Python v3.14, v3.13
okta 3.1.0, 3.0.0

Affected Class/Method(s)

okta.*

Customer Information

Organization Name: hingehealth-wf
Paid Customer: yes

Code Snippet

# Your code here

Debug Output / Traceback

│ Error Message: ERROR: Could not find a version that satisfies the requirement flatdict>=4.0.1 (from okta) (from versions: 1.1.3, 1.2.0, 2.0.0, 2.0.1, 3.0.0, 3.0.1, 3.1.0, 3.1.1, 3.2.0, 3.2.1, 3.3.0, 3.4.0)
│ ERROR: No matching distribution found for flatdict>=4.0.1

Expected Behavior

Installing the package, regardless of pip options, should result in a clean install.

Actual Behavior

Installing with pip install --no-binary :all: results in the above error. The flatdict library only distributes sdists, and so it cannot be installed when it is required to use pre-built packages. This means that installers, such as those that have to build for different architectures than their build environment, cannot install the package. An example is building an AWS Lambda function. You would normally do something like this to build the package:

pip3 install \
  --upgrade \
  --no-cache :all: \
  --no-cache-dir \
  --platform manylinux2014_x86_64 \
  --implementation cp \
  --target /lambda \
"okta>=3.0.0"

However, installing in this way is not possible. Installing without --no-cache :all: is not possible when --patform or --implementation are set. It's worth noting that the flatdict library hasn't seen an update in around 5 years and so is not likely to see any love.

Steps to reproduce

pip3 install \
  --upgrade \
  --no-cache :all: \
  --no-cache-dir \
  --platform manylinux2014_x86_64 \
  --implementation cp \
  --target /lambda \
"okta>=3.0.0"

References

No response

Activity

  1. michaelncy commented on Feb 9, 2026

    @michaelncy

    The issue seems to be in the latest version of setuptools which removes the pkg_resources module, which flatdict uses in the build process: https://github.com/pypa/setuptools/blob/main/NEWS.rst

  2. LivingInSyn commented on Feb 9, 2026

    @LivingInSyn

    does anyone have a workaround?

  3. moloneyd-draeger commented on Feb 9, 2026

    @moloneyd-draeger

    Documenting a workaround for visitors to this thread: pinning the version of setuptools used to build the flatdict wheel files should fix your issues until the problem is resolved (somewhere) upstream.

    Pinning build constraints with pip: https://pip.pypa.io/en/stable/user_guide/#build-constraints

    Example build-constraints.txt file added to repository root

    setuptools==80.10.2

    Solution for the builds in my team using tox to manage CI

    tox.ini

    [testenv]
    # other config removed
    install_command = pip install -v --build-constraint build-constraints.txt {opts} {packages}
    setenv =
        VIRTUALENV_PIP==26.0.1
    # we had to manually set the pip version here because some builds were 
    # defaulting to a pip < 25.3 that did not support the --build-constraint option
    # remaining setenv config not shown, but should not affect this workaround
  4. LivingInSyn commented on Feb 9, 2026

    @LivingInSyn

    For those using poetry

    [tool.poetry.build-constraints]
    flatdict = { setuptools = "=80.10.2" }
    
  5. macintacos commented on Feb 10, 2026

    @macintacos

    While this should be fixed, I would advocate for removing this dependency on flatdict altogether - the project hasn't been touched in about 6 years, and it's only used in parsing the configuration.

  6. diogommartins commented on Feb 11, 2026

    @diogommartins

    Agree with @macintacos , this dep should probably be removed. I tried fixing it in the repo (gmr/flatdict#61), but there's no activity and answer from the author for a while now

  7. chrisgilmerproj commented on Feb 12, 2026

    @chrisgilmerproj

    Throwing in another agreement with @macintacos - flatdict doesn't seem like high enough value for this project to rely on it. Couple that with the fact the project is effectively unmaintained it should probably be dropped. A quick resolution to this would be appreciated. Thank you in advance for the quick work.

  8. 21 remaining items

  9. ilaikim99 commented on Feb 28, 2026

    @ilaikim99

    This is part of the setuptools 82 breakage — it removed pkg_resources, which flatdict's sdist build script imports. The fix is to constrain setuptools only for that build step, not globally. Works for pip, uv, Poetry, and Lambda Dockerfiles. Full breakdown: https://cacheoverflow.dev/blog/iihKM3Ao

  10. chrisgilmerproj commented on Mar 4, 2026

    @chrisgilmerproj

    This appears to be solved by #504

  11. BinoyOza-okta commented on Apr 6, 2026

    @BinoyOza-okta
    Contributor

    The issue has been resolved and released in v3.2.0. Hence, closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions