Skip to content

Commit

Permalink
#11655 Update package metadata (#11656)
Browse files Browse the repository at this point in the history
  • Loading branch information
adiroiban committed Oct 24, 2022
2 parents 4b62da0 + b9dd2b6 commit 960e26b
Show file tree
Hide file tree
Showing 13 changed files with 262 additions and 366 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Expand Up @@ -164,7 +164,7 @@ jobs:
- python-version: '3.7'
tox-env: 'alldeps-gtk-withcov-posix'
trial-target: 'twisted.internet.test'
platform-deps: 'gtk_platform'
platform-deps: 'gtk-platform'
tox-wrapper: 'xvfb-run -a'
job-name: 'gtk-tests'

Expand Down Expand Up @@ -210,7 +210,7 @@ jobs:
# Make sure the matrix is defined in such a way that this is triggered
# only on Linux.
- name: Install GTK system deps
if: matrix.platform-deps == 'gtk_platform'
if: matrix.platform-deps == 'gtk-platform'
run: |
# *-dev dependencies are for pygobject
# https://gitlab.gnome.org/GNOME/pygobject/-/blob/3.42.0/setup.py#L129-L134
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Expand Up @@ -26,4 +26,4 @@ python:
- method: pip
path: .
extra_requirements:
- dev_release
- dev-release
93 changes: 0 additions & 93 deletions MANIFEST.in

This file was deleted.

62 changes: 0 additions & 62 deletions admin/twisted.spec

This file was deleted.

2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -28,7 +28,7 @@

# -- General configuration ------------------------------------------------

# See setup.cfg for the Sphinx version required to build the documentation.
# See pyproject.toml for the Sphinx version required to build the documentation.
# needs_sphinx is not use to avoid duplication and getting these values
# out of sync.

Expand Down
15 changes: 7 additions & 8 deletions docs/development/coding-standard.rst
Expand Up @@ -393,15 +393,14 @@ This makes the script more portable but note that it is not a foolproof method.
Always make sure that ``/usr/bin/env`` exists or use a softlink/symbolic link to point it to the correct path.
Python's distutils will rewrite the shebang line upon installation so this policy only covers the source files in version control.

#. For core scripts, add an entry point to ``"console_scripts"`` in ``setup.cfg``:
#. For core scripts, add an entry point to ``[project.scripts]`` in ``pyproject.toml``:

.. code-block:: cfg
.. code-block:: toml
[options.entry_points]
console_scripts =
...
twistd = twisted.scripts.twistd:run
yourmodule = twisted.scripts.yourmodule:run
[project.scripts]
...
twistd = "twisted.scripts.twistd:run"
yourmodule = "twisted.scripts.yourmodule:run"
#. And end with:

Expand All @@ -416,7 +415,7 @@ Python's distutils will rewrite the shebang line upon installation so this polic


This will ensure that your program will have a proper ``console_scripts`` entry point, which
``setup.py`` will use to generate a console script which will work correctly for users of
``pyproject.toml`` will use to generate a console script which will work correctly for users of
Git, Windows releases and Debian packages.


Expand Down
8 changes: 4 additions & 4 deletions docs/installation/howto/optional.rst
Expand Up @@ -36,17 +36,17 @@ The following optional dependencies are supported:
* `pyasn1`_
* `cryptography`_

* **conch_nacl** - **conch** options and `PyNaCl`_ to support Ed25519 keys on systems with OpenSSL < 1.1.1b.
* **conch-nacl** - **conch** options and `PyNaCl`_ to support Ed25519 keys on systems with OpenSSL < 1.1.1b.

* **soap** - the `SOAPpy`_ package to work with SOAP.

* **serial** - the `pyserial`_ package to work with serial data.

* **all_non_platform** - installs **tls**, **conch**, **soap**, and **serial** options.
* **all-non-platform** - installs **tls**, **conch**, **soap**, and **serial** options.

* **macos_platform** - **all_non_platform** options and `pyobjc`_ to work with Objective-C apis.
* **macos-platform** - **all-non-platform** options and `pyobjc`_ to work with Objective-C apis.

* **windows_platform** - **all_non_platform** options and `pywin32`_ to work with Windows's apis.
* **windows-platform** - **all-non-platform** options and `pywin32`_ to work with Windows's apis.

* **http2** - packages needed for http2 support.

Expand Down
20 changes: 20 additions & 0 deletions hatch_build.py
@@ -0,0 +1,20 @@
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from hatchling.metadata.plugin.interface import MetadataHookInterface


class CustomMetadataHook(MetadataHookInterface):
def update(self, metadata):
optional_dependencies = self.config["optional-dependencies"]
for feature, dependencies in list(optional_dependencies.items()):
if "-" not in feature:
continue

# We define all the legacy dependency targets using the
# underscore for backward compatibility.
#
# See: https://github.com/twisted/twisted/pull/11656#issuecomment-1282855123
legacy_feature = feature.replace("-", "_")
optional_dependencies[legacy_feature] = dependencies

metadata["optional-dependencies"] = optional_dependencies

0 comments on commit 960e26b

Please sign in to comment.