Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| python:portspolicy [2020/02/18 02:45] – Add entries to PORTNAME and re-order KubilayKocak | python:portspolicy [2023/03/02 02:17] (current) – emphasise case-sensitivity CharlieLi | ||
|---|---|---|---|
| Line 20: | Line 20: | ||
| ===== Naming ===== | ===== Naming ===== | ||
| - | ==== General | + | ==== Prefixing (py-*) |
| - | | + | **Guideline**: |
| - | ==== Prefixing | + | * Port directory name MUST be lowercase('' |
| * Python ports MUST be prefixed with '' | * Python ports MUST be prefixed with '' | ||
| - | * Compelling cases do NOT include: | + | * Compelling cases do NOT include: |
| * [[Python/ | * [[Python/ | ||
| * Package is not listed in %%PyPI%% | * Package is not listed in %%PyPI%% | ||
| Line 34: | Line 34: | ||
| ==== PORTNAME ==== | ==== PORTNAME ==== | ||
| + | |||
| + | **Guideline**: | ||
| // | // | ||
| Line 39: | Line 41: | ||
| Check if a package is registered in %%PyPI%% (CHEESESHOP), | Check if a package is registered in %%PyPI%% (CHEESESHOP), | ||
| - | * '' | + | * If the package is registered on %%PyPI%% |
| - | * '' | + | * '' |
| - | | + | * The %%PyPI%% package name is that which is displayed in the URL at [[https:// |
| - | + | ||
| - | * The %%PyPI%% package name is that which is displayed | + | |
| * Note: The displayed %%PyPI%% package name can be different than the package name specified in '' | * Note: The displayed %%PyPI%% package name can be different than the package name specified in '' | ||
| - | + | * If the package is **NOT** registered on %%PyPI%%: | |
| - | * Ports MUST NOT modify the name if it already contains '' | + | |
| - | * Ports MUST include all non-alpha numeric characters in the name (such as dashes (-%%))%% | + | |
| + | * Ports MUST include all non-alpha numeric characters in the name (such as dashes (-%%))%% | ||
| * This also applies if %%PyPi%% (CHEESESHOP) is NOT used for '' | * This also applies if %%PyPi%% (CHEESESHOP) is NOT used for '' | ||
| ==== PKGNAMEPREFIX ==== | ==== PKGNAMEPREFIX ==== | ||
| + | |||
| + | **Guideline**: | ||
| * Ports MUST use '' | * Ports MUST use '' | ||
| * '' | * '' | ||
| - | ===== CATEGORIES | + | ===== Metadata |
| + | |||
| + | ==== CATEGORIES ==== | ||
| + | |||
| + | **Guideline**: | ||
| * Ports MUST add '' | * Ports MUST add '' | ||
| * Ports SHOULD add multiple '' | * Ports SHOULD add multiple '' | ||
| + | |||
| + | ==== COMMENT ==== | ||
| + | |||
| + | **Guideline**: | ||
| + | |||
| + | * Ports SHOULD match the upstream short description or summary where possible, modulo requirements and changes for portlint compliance | ||
| + | * For Python ports, this almost always means what is defined in '' | ||
| ===== MASTER_SITES ===== | ===== MASTER_SITES ===== | ||
| - | Ports SHOULD use '' | + | **Guideline**: |
| + | |||
| + | * Ports SHOULD use '' | ||
| - | Examples where temporarily using an alternate MASTER_SITES is OK: | + | Examples where temporarily using an alternate MASTER_SITES is warranted: |
| - | * Certain | + | * Some files are not correctly packaged |
| - | * A source distribution (sdist, aka tarball) has not been uploaded yet. | + | * A source distribution (sdist) has not been uploaded yet |
| In these cases, issues or pull request SHOULD be created upstream to rectify the problem, and MASTER_SITES switched to CHEESESHOP when the change is released in a later version. | In these cases, issues or pull request SHOULD be created upstream to rectify the problem, and MASTER_SITES switched to CHEESESHOP when the change is released in a later version. | ||
| Line 76: | Line 91: | ||
| ===== USES=python ===== | ===== USES=python ===== | ||
| + | |||
| + | **Guideline**: | ||
| + | **Guideline**: | ||
| * Python ports MUST declare USES=python '' | * Python ports MUST declare USES=python '' | ||
| Line 83: | Line 101: | ||
| ===== USE_PYTHON Features ===== | ===== USE_PYTHON Features ===== | ||
| + | |||
| + | **Guideline**: | ||
| + | |||
| + | ==== pep517 ==== | ||
| + | |||
| + | * Packages following PEP-517 (have a pyproject.toml specifying a build backend that builds an installable wheel) SHALL use pep517, unless there is a compelling reason not to. | ||
| + | |||
| + | ==== distutils ==== | ||
| + | |||
| + | * Packages that use distutils (directly executes a setup.py, import distutils/ | ||
| ==== autoplist ==== | ==== autoplist ==== | ||
| + | * Packages following PEP-517 (have a pyproject.toml specifying a build backend that builds an installable wheel) and built as such SHALL use autoplist. | ||
| * Packages that use distutils (have a setup.py, import distutils/ | * Packages that use distutils (have a setup.py, import distutils/ | ||
| Line 97: | Line 126: | ||
| See Also: https:// | See Also: https:// | ||
| - | |||
| - | ==== distutils ==== | ||
| - | |||
| - | * Packages that use distutils (have a setup.py, import distutils/ | ||
| ===== Dependencies ===== | ===== Dependencies ===== | ||
| + | |||
| + | **Guideline**: | ||
| **IMPORTANT**: | **IMPORTANT**: | ||
| Line 113: | Line 140: | ||
| * Refer to '' | * Refer to '' | ||
| * Refer to '' | * Refer to '' | ||
| - | * Refer to '' | + | * Refer to '' |
| * Port maintainers SHOULD fix missing or incorrectly specified dependencies, | * Port maintainers SHOULD fix missing or incorrectly specified dependencies, | ||
| * Use common sense for upstream version requirements that set //maximum versions// or pin //very specific// versions, eg: '' | * Use common sense for upstream version requirements that set //maximum versions// or pin //very specific// versions, eg: '' | ||
| + | * **IMPORTANT**: | ||
| ==== Modifying Dependencies ==== | ==== Modifying Dependencies ==== | ||
| Line 122: | Line 150: | ||
| * Ports MAY patch dependencies in the upstream sources (WRKSRC), if they need to be added, modified or removed. | * Ports MAY patch dependencies in the upstream sources (WRKSRC), if they need to be added, modified or removed. | ||
| * When patching dependencies, | * When patching dependencies, | ||
| - | * Example: Changing '' | + | * Example: Changing '' |
| ==== Optional Dependencies ==== | ==== Optional Dependencies ==== | ||
| Line 130: | Line 158: | ||
| * Port OPTIONS for optional functionality, | * Port OPTIONS for optional functionality, | ||
| - | ==== Transitive Dependencies ==== | + | ==== Optional / Transitive Dependencies ==== |
| * If a package depends on another packages **optional** dependencies, | * If a package depends on another packages **optional** dependencies, | ||
| - | * Eg: Package A depends on %%PackageB%%[optional] (defined in extras_require). Package A should depend explicitly on all dependencies listed in Package B's %%%%'' | + | * Example: Package A depends on %%PackageB%%[optional] (defined in extras_require). Package A should depend explicitly on all dependencies listed in Package B's %%%%'' |
| ===== Tests ===== | ===== Tests ===== | ||
| + | |||
| + | **Guideline**: | ||
| * Python ports SHOULD include a '' | * Python ports SHOULD include a '' | ||
| + | * Example: '' | ||
| * Python ports SHOULD add '' | * Python ports SHOULD add '' | ||
| ===== Patches ===== | ===== Patches ===== | ||
| + | |||
| + | **Guideline**: | ||
| * Python ports SHOULD [[Python/ | * Python ports SHOULD [[Python/ | ||
| Line 147: | Line 180: | ||
| ===== Upstreaming ===== | ===== Upstreaming ===== | ||
| + | |||
| + | **Guideline**: | ||
| * Python port maintainers SHOULD (strongly encouraged) aim to: | * Python port maintainers SHOULD (strongly encouraged) aim to: | ||
| Line 161: | Line 196: | ||
| ==== Packages and Modules ==== | ==== Packages and Modules ==== | ||
| - | * Ports that install Python modules or packages (anything going into '' | + | * Ports that install Python modules or packages (anything going into '' |
| * Executable scripts being installed MUST use '' | * Executable scripts being installed MUST use '' | ||
| Line 167: | Line 202: | ||
| * Ports depending on Python to build MUST use'' | * Ports depending on Python to build MUST use'' | ||
| - | * Ports MUST NOT use version-unspecific Python invocations such as '' | + | * Ports MUST NOT use version-unspecific Python invocations such as '' |
| This allows ports to be built with different default versions of Python. | This allows ports to be built with different default versions of Python. | ||