Fail to import module via github url

Đang mở
#9 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

@jnnr đang làm issue này rồi.

Từ ngày 11/10/2026.

  • #13 của @jnnr — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
65/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github, python
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Start by reproducing the import with the shown module definition and pixi run snakemake -c 2 all_grid_builder. Read workflow/Snakefile and the scripts._schema reference named in the traceback; the work is done when the GitHub-imported module resolves load_region_configs and the target completes without the ImportError.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Describe the bug
As of now, grid-builder cannot be imported into another Snakemake workflow by pointing to the github url.

To Reproduce
Steps to reproduce the behavior:

  1. Import the module into a Snakemake workflow.
configfile: "config/modules/grid_builder.yaml"


module module_grid_builder:
    pathvars:
        logs="results/module_grid_builder/logs",
        resources="results/module_grid_builder/resources",
        results="results/module_grid_builder/results",
    snakefile:
        github(
            "pypsa/grid-builder",
            path="workflow/Snakefile",
            tag="6905b99",
        )
    config:
        config["grid_builder"]


use rule * from module_grid_builder as module_grid_builder_*

rule all_grid_builder:
    default_target: True
    input:
        rules.module_grid_builder_retrieve_osm_all.input,
  1. Request something from the module

pixi run snakemake -c 2 all_grid_builder

  1. See error
ImportError in file "https://raw.githubusercontent.com/pypsa/grid-builder/6905b99/workflow/Snakefile", line 8:
cannot import name 'load_region_configs' from 'scripts._schema'
  File "https://raw.githubusercontent.com/pypsa/grid-builder/6905b99/workflow/Snakefile", line 8, in <module>

Expected behavior
The reference to scripts._schema should be correctly resolved.

Desktop (please complete the following information):

  • OS: Linux Fedora 43
Ngôn ngữ chính
Python
Star
7
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PyPSA/grid-builder

Tất cả issue của PyPSA/grid-builder

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.