Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add aDistribution.editable property #510

Open
Labels
@FFY00

Description

@FFY00

Recently, when trying to check if a distribution is editable, I noticed doing so using the current API is very un-ergonomic. This information is available via thedirect_url.json file ofPEP 610, which is exposed inDistribution.origin.

When url refers to a local directory, the dir_info key MUST be present as a dictionary with the following key:

editable (type:boolean):true if the distribution was installed in editable mode,false otherwise. If absent, default tofalse.

So, to check if the distribution is editable, we can checkDistribution.origin.dir_info.editable, however,Distribution.origin might beNone (nodirect_url.json), andDistribution.origin.dir_info might not be set (url indirect_url.json in not a local directory), which.

is_editable=distribution.originanddistribution.origin.dir_infoanddistribution.origin.dir_info.editable
try:is_editable=distribution.origin.dir_info.editableexceptAttributeError:is_editable=False

It would be helpful to have this information available via a more ergonomic API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp