Snakemake version 8+ doesn't handle local imports appropriately
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 148
- Forks
- 55
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 18
Description
Version Checks (indicate both or one)
-
This bug exists on the master branch of PyPSA-USA.
-
This bug exists on the develop branch of PyPSA-USA.
The Issue
Snakemake v8+ changes the way the directory is cached. This causes error messages related to any local imports of the PyPSA-USA scripts directory. This can be fixed 2 ways:
-
Temp fix: import the directory path to the system $PYTHONPATH in the terminal:
export PYTHONPATH="/scratch/htc/oet/044_kinetics/pypsa-usa/workflow/scripts:$PYTHONPATH" -
Permanent fix: add the directory path during script execution
sys.path.insert(0, os.path.dirname(__file__))in each affected file
Steps To Reproduce
No response
Error Message
Anything else?
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the affected files under workflow/scripts and checking how their local imports behave with Snakemake v8+ on both the master and develop branches. Reproduce the import error without the PYTHONPATH workaround, then verify that each affected script runs with its local imports resolved during execution without requiring that environment variable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 48/100