Skip to content

python3Packages.parsedmarc: correct location of dependency management #337081

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AndrewKvalheim
Copy link
Member

@AndrewKvalheim AndrewKvalheim commented Aug 24, 2024

Description of changes

Background

parsedmarc is both a Python module and CLI application which uses the module. Packaging of the Python module is currently broken by an unmet dependency. Packaging of the CLI application worked around this without correcting the broken module.

Proposed change

Instead of managing the module’s dependencies in the application’s package, manage them in the module’s package. This will allow both the module and application to be usable.

Before:

  • pkgs.python3Packages.parsedmarc module, broken by unmanaged dependencies
  • pkgs.parsedmarc application
    • Management of the module’s dependencies, via override

After:

  • pkgs.python3Packages.parsedmarc module
    • Management of the module’s dependencies
  • pkgs.parsedmarc application

Example

Test functions
test_application() {
  nix-shell \
    --packages 'parsedmarc' \
    --run 'env --unset PYTHONPATH parsedmarc --version'
}

test_module() {
  nix-shell \
    --packages 'python3Packages.parsedmarc' \
    --run "python -c 'import parsedmarc; print(parsedmarc.email.policy.default)'"
}

Before:

$ test_module
error: Package ‘python3.12-parsedmarc-8.12.0’ in …/pkgs/development/python-modules/parsedmarc/default.nix:103 is marked as broken, refusing to evaluate.
$ test_application
8.12.0

After:

$ test_module
EmailPolicy()
$ test_application
8.12.0

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Aug 24, 2024
@ofborg ofborg bot requested a review from talyz August 24, 2024 20:40
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Aug 24, 2024
@farcaller
Copy link
Contributor

The elasticsearch-dsl version seems to be broken, too. Should we use a better approach that honors the upstream's requested deps?

@AndrewKvalheim
Copy link
Member Author

If you’re asking me—I have no idea; I don’t know what elasticsearch-dsl is or how to identify that its version is broken. I don’t personally use that functionality.

This PR is a proposal that management of python3Packages.parsedmarc’s dependencies—whatever that entails—happens in python3Packages.parsedmarc, not downstream in parsedmarc.

@AndrewKvalheim AndrewKvalheim force-pushed the python3Packages.parsedmarc/msgraph-core branch from 9460871 to 438a865 Compare November 13, 2024 20:40
@farcaller
Copy link
Contributor

elasticsearch-dsl is another dependency in this file. It's pulled from nixpkgs at (currently 8.15.3), but parsedmarc has a strict request for elasticsearch-dsl==7.4.0 and thus is broken.

@AndrewKvalheim AndrewKvalheim changed the title parsedmarc: move dependency override from application to module parsedmarc: move dependency override from application to Python module Nov 14, 2024
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 2, 2025
@nixpkgs-ci nixpkgs-ci bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 25, 2025
python3Packages.parsedmarc was broken by updating msgraph-core from
major version 0 to 1 in NixOS#294305. A workaround was subsequently applied
to the parsedmarc application in NixOS#280940 but the module remained broken.
@AndrewKvalheim AndrewKvalheim force-pushed the python3Packages.parsedmarc/msgraph-core branch from 3fd86ea to 068787c Compare July 28, 2025 13:15
@nixpkgs-ci nixpkgs-ci bot removed 2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md labels Jul 28, 2025
@AndrewKvalheim AndrewKvalheim changed the title parsedmarc: move dependency override from application to Python module python3Packages.parsedmarc: correct location of dependency management Aug 17, 2025
@AndrewKvalheim
Copy link
Member Author

I don’t think this PR is the right place to introduce new dependency management; I’m just trying to change where that happens, so that both the application and module will benefit from it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants