Skip to content

python_library_naming_convention Gazelle directive is ignored when python_generation_mode set to "file" #1677

@yechuan51

Description

@yechuan51

🐞 bug report

Affected Rule

rules_python

Is this a regression?

I tried earlier version of rules_python, but it appears that earlier version either don't support python_generation_mode=file or produce the same result.

Description

python_library_naming_convention appears to be ignored if python_generation_mode is set to "file" mode. When I set "python_library_naming_convention" to "$package_name$_lib" and "python_generation_mode" to "file", the generated python_library target is still "$package_name".

But once I remove "python_generation_mode" rule, the generated target shows up with the expected name(i.e. foo_lib).

🔬 Minimal Reproduction

I don't yet have the time to produce a minimal reproduction yet. But if needed, I can look into this.

It should be as simple as setting both directive and run Gazelle.

🔥 Exception or Error

python_library_naming_convention is ignored.

🌍 Your Environment

Operating System:

  
MacOS 14.1.2
  

Output of bazel version:

  
Build label: 7.0.0
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Mon Dec 11 17:00:42 2023 (1702314042)
Build timestamp: 1702314042
Build timestamp as int: 1702314042
  

Rules_python version:

  
0.27.1
  

Anything else relevant?

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