diff options
author | CoprDistGit <infra@openeuler.org> | 2023-04-11 16:38:09 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-04-11 16:38:09 +0000 |
commit | 2362037ce79af5afd48b18b7b884041291bcad7f (patch) | |
tree | e8b47d5986222e52057f124ad3c3d539df7317db | |
parent | af9b9eea83f2966f18e52fc6eecc410bd67c0250 (diff) |
automatic import of python-pdm-pep517
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-pdm-pep517.spec | 627 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 629 insertions, 0 deletions
@@ -0,0 +1 @@ +/pdm-pep517-1.1.3.tar.gz diff --git a/python-pdm-pep517.spec b/python-pdm-pep517.spec new file mode 100644 index 0000000..534a154 --- /dev/null +++ b/python-pdm-pep517.spec @@ -0,0 +1,627 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pdm-pep517 +Version: 1.1.3 +Release: 1 +Summary: A PEP 517 backend for PDM that supports PEP 621 metadata +License: MIT +URL: https://pypi.org/project/pdm-pep517/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/d6/d7/bee6e16a0a5e93f38f2f8224183ea6c36cfde1ee93cf5e941f1d6cdb20cf/pdm-pep517-1.1.3.tar.gz +BuildArch: noarch + + +%description +# PDM-PEP517 + +**This project has been renamed and re-published as [pdm-backend](https://pypi.org/project/pdm-backend)** + +Yet another [PEP 517][1] backend. + +[](https://pypi.org/project/pdm-pep517) +[](https://github.com/pdm-project/pdm-pep517/actions/workflows/ci.yml) +[](https://results.pre-commit.ci/latest/github/pdm-project/pdm-pep517/master) +[](https://pdm.fming.dev) + +This is the backend for [PDM](https://pdm.fming.dev) projects, while you can also use it alone. +It reads the metadata of [PEP 621][2] format and coverts it to [Core metadata][3]. + +[1]: https://www.python.org/dev/peps/pep-0517/ +[2]: https://www.python.org/dev/peps/pep-0621/ +[3]: https://packaging.python.org/specifications/core-metadata/ + +## Use as PEP 517 build backend + +Edit your `pyproject.toml` as follows: + +```toml +[build-system] +requires = ["pdm-pep517"] +build-backend = "pdm.pep517.api" +``` + +## Tool specific settings + +Besides of the standard fields specified in PEP 621, PDM-PEP517 honors some other settings to change the build behavior. They should be defined under `[tool.pdm.build]` table: + +```toml +[tool.pdm.build] +# Specify where the Python packages live. +package-dir = "src" +# File patterns to include, the paths are relative to the project root. +includes = [] +# File patterns to exclude, the paths are relative to the project root. +excludes = [] +# File patterns to include in source distribution and exclude in wheel distribution. +source-includes = [] +# An extra script to populate the arguments of `setup()`, one can build C extensions with this script. Or a custom build() function to generate files. +setup-script = "build.py" +# If true, the setup-script will run in a generated `setup.py` file. +run-setuptools = false +# Override the Is-Purelib value in the wheel. +is-purelib = true +# Change the editable-backend: path(default) or editables +editable-backend = "editables" +``` + +You don't have to specify all of them, PDM-PEP517 can also derive these fields smartly, based on some best practices of Python packaging. + +## Dynamic project version + +`pdm-pep517` can also determine the version of the project dynamically. To do this, you need to leave the `version` field out from your `pyproject.toml` and add `dynamic = ["version"]`: + +```diff +[project] +... +- version = "0.1.0" remove this line ++ dynamic = ["version"] +``` + +Then in `[tool.pdm.version]` table, specify how to get the version info. There are two ways supported: + +1. Read from a static string in the given file path: + +```toml +[tool.pdm.version] +source = "file" +path = "mypackage/__init__.py" +``` + +In this way, the file MUST contain a line like: + +```python +__version__ = "0.1.0" # Single quotes and double quotes are both OK, comments are allowed. +``` + +2. Read from SCM tag, supporting `git` and `hg`: + +```toml +[tool.pdm.version] +source = "scm" +``` + +When building from a source tree where SCM is not available, you can use the env var `PDM_PEP517_SCM_VERSION` to pretend the version is set. + +```bash +PDM_PEP517_SCM_VERSION=0.1.0 python -m build +``` + +## Writing SCM version to file + +You can instruct PDM-PEP517 to write back the dynamic version fetched from SCM to a file: + +```toml +[tool.pdm.version] +source = "scm" +write_to = "foo/version.txt" +``` + +By default, PDM-PEP517 will just write the SCM version itself. +You can provide a template as a Python-formatted string to create a syntactically correct Python assignment: + +```toml +[tool.pdm.version] +source = "scm" +write_to = "foo/_version.py" +write_template = "__version__ = '{}'" +``` + +Note that PDM-PEP517 will rewrite the whole file each time, so you can't have additional contents in that file. + +## Custom Build Script + +With custom build script, you can call other tools to generates files to be included in the wheel. +Just set the `setup-script` field under `[tool.pdm.build]` table to the path of the script. + +In the script, you expose a function named `build`, which takes two arguments: + +- `src`(str): the path of the source directory +- `dst`(str): the path of the destination directory + +Example: + +```python + +def build(src, dst): + with open(os.path.join(dst, "myfile.txt"), "w") as f: + # Put a file in the wheel + f.write("Hello World!") +``` +Note that the generated file hierarchy will be preserved in the wheel: `$dst/myfile.txt` -> `$wheel_root/myfile.txt`. + +When `run-setuptools` is `true`, the `build` function will be called in a generated `setup.py` file, with the setup parameters as the only argument. + +Example: + +```python + +def build(setup_params): + # add ext_modules to the setup() arguments + setup_parms.update(ext_modules=[Extension("myextension", ["myextension.c"])]) +``` + +The will result in a `setup()` call like following: + +```python +setup( + name="mypackage", + # Other metadata fields + ext_modules=[Extension("myextension", ["myextension.c"])], +) +``` + +**By default, when `setup-script` is set, the resulted wheel will be platform-specific, but you can override this behavior by setting `is-purelib` to `false`** + +## Supported config settings + +`pdm-pep517` allows passing `config_settings` to modify the build behavior. It use the same option convention as `python setup.py bdist_wheel`. + +``` +--python-tag + Override the python implementation compatibility tag(e.g. cp37, py3, pp3) +--py-limited-api + Python tag (cp32|cp33|cpNN) for abi3 wheel tag +--plat-name + Override the platform name(e.g. win_amd64, manylinux2010_x86_64) +``` + +For example, you can supply these options with [build](https://pypi.org/project/build/): + +```bash +python -m build --sdist --wheel --outdir dist/ --config-setting="--python-tag=cp37" --config-setting="--plat-name=win_amd64" +``` + +`pip` doesn't support passing `config_settings` yet, please stick to `build` as the recommended frontend. + +## License + +This project is licensed under [MIT license](/LICENSE). + + + +%package -n python3-pdm-pep517 +Summary: A PEP 517 backend for PDM that supports PEP 621 metadata +Provides: python-pdm-pep517 +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pdm-pep517 +# PDM-PEP517 + +**This project has been renamed and re-published as [pdm-backend](https://pypi.org/project/pdm-backend)** + +Yet another [PEP 517][1] backend. + +[](https://pypi.org/project/pdm-pep517) +[](https://github.com/pdm-project/pdm-pep517/actions/workflows/ci.yml) +[](https://results.pre-commit.ci/latest/github/pdm-project/pdm-pep517/master) +[](https://pdm.fming.dev) + +This is the backend for [PDM](https://pdm.fming.dev) projects, while you can also use it alone. +It reads the metadata of [PEP 621][2] format and coverts it to [Core metadata][3]. + +[1]: https://www.python.org/dev/peps/pep-0517/ +[2]: https://www.python.org/dev/peps/pep-0621/ +[3]: https://packaging.python.org/specifications/core-metadata/ + +## Use as PEP 517 build backend + +Edit your `pyproject.toml` as follows: + +```toml +[build-system] +requires = ["pdm-pep517"] +build-backend = "pdm.pep517.api" +``` + +## Tool specific settings + +Besides of the standard fields specified in PEP 621, PDM-PEP517 honors some other settings to change the build behavior. They should be defined under `[tool.pdm.build]` table: + +```toml +[tool.pdm.build] +# Specify where the Python packages live. +package-dir = "src" +# File patterns to include, the paths are relative to the project root. +includes = [] +# File patterns to exclude, the paths are relative to the project root. +excludes = [] +# File patterns to include in source distribution and exclude in wheel distribution. +source-includes = [] +# An extra script to populate the arguments of `setup()`, one can build C extensions with this script. Or a custom build() function to generate files. +setup-script = "build.py" +# If true, the setup-script will run in a generated `setup.py` file. +run-setuptools = false +# Override the Is-Purelib value in the wheel. +is-purelib = true +# Change the editable-backend: path(default) or editables +editable-backend = "editables" +``` + +You don't have to specify all of them, PDM-PEP517 can also derive these fields smartly, based on some best practices of Python packaging. + +## Dynamic project version + +`pdm-pep517` can also determine the version of the project dynamically. To do this, you need to leave the `version` field out from your `pyproject.toml` and add `dynamic = ["version"]`: + +```diff +[project] +... +- version = "0.1.0" remove this line ++ dynamic = ["version"] +``` + +Then in `[tool.pdm.version]` table, specify how to get the version info. There are two ways supported: + +1. Read from a static string in the given file path: + +```toml +[tool.pdm.version] +source = "file" +path = "mypackage/__init__.py" +``` + +In this way, the file MUST contain a line like: + +```python +__version__ = "0.1.0" # Single quotes and double quotes are both OK, comments are allowed. +``` + +2. Read from SCM tag, supporting `git` and `hg`: + +```toml +[tool.pdm.version] +source = "scm" +``` + +When building from a source tree where SCM is not available, you can use the env var `PDM_PEP517_SCM_VERSION` to pretend the version is set. + +```bash +PDM_PEP517_SCM_VERSION=0.1.0 python -m build +``` + +## Writing SCM version to file + +You can instruct PDM-PEP517 to write back the dynamic version fetched from SCM to a file: + +```toml +[tool.pdm.version] +source = "scm" +write_to = "foo/version.txt" +``` + +By default, PDM-PEP517 will just write the SCM version itself. +You can provide a template as a Python-formatted string to create a syntactically correct Python assignment: + +```toml +[tool.pdm.version] +source = "scm" +write_to = "foo/_version.py" +write_template = "__version__ = '{}'" +``` + +Note that PDM-PEP517 will rewrite the whole file each time, so you can't have additional contents in that file. + +## Custom Build Script + +With custom build script, you can call other tools to generates files to be included in the wheel. +Just set the `setup-script` field under `[tool.pdm.build]` table to the path of the script. + +In the script, you expose a function named `build`, which takes two arguments: + +- `src`(str): the path of the source directory +- `dst`(str): the path of the destination directory + +Example: + +```python + +def build(src, dst): + with open(os.path.join(dst, "myfile.txt"), "w") as f: + # Put a file in the wheel + f.write("Hello World!") +``` +Note that the generated file hierarchy will be preserved in the wheel: `$dst/myfile.txt` -> `$wheel_root/myfile.txt`. + +When `run-setuptools` is `true`, the `build` function will be called in a generated `setup.py` file, with the setup parameters as the only argument. + +Example: + +```python + +def build(setup_params): + # add ext_modules to the setup() arguments + setup_parms.update(ext_modules=[Extension("myextension", ["myextension.c"])]) +``` + +The will result in a `setup()` call like following: + +```python +setup( + name="mypackage", + # Other metadata fields + ext_modules=[Extension("myextension", ["myextension.c"])], +) +``` + +**By default, when `setup-script` is set, the resulted wheel will be platform-specific, but you can override this behavior by setting `is-purelib` to `false`** + +## Supported config settings + +`pdm-pep517` allows passing `config_settings` to modify the build behavior. It use the same option convention as `python setup.py bdist_wheel`. + +``` +--python-tag + Override the python implementation compatibility tag(e.g. cp37, py3, pp3) +--py-limited-api + Python tag (cp32|cp33|cpNN) for abi3 wheel tag +--plat-name + Override the platform name(e.g. win_amd64, manylinux2010_x86_64) +``` + +For example, you can supply these options with [build](https://pypi.org/project/build/): + +```bash +python -m build --sdist --wheel --outdir dist/ --config-setting="--python-tag=cp37" --config-setting="--plat-name=win_amd64" +``` + +`pip` doesn't support passing `config_settings` yet, please stick to `build` as the recommended frontend. + +## License + +This project is licensed under [MIT license](/LICENSE). + + + +%package help +Summary: Development documents and examples for pdm-pep517 +Provides: python3-pdm-pep517-doc +%description help +# PDM-PEP517 + +**This project has been renamed and re-published as [pdm-backend](https://pypi.org/project/pdm-backend)** + +Yet another [PEP 517][1] backend. + +[](https://pypi.org/project/pdm-pep517) +[](https://github.com/pdm-project/pdm-pep517/actions/workflows/ci.yml) +[](https://results.pre-commit.ci/latest/github/pdm-project/pdm-pep517/master) +[](https://pdm.fming.dev) + +This is the backend for [PDM](https://pdm.fming.dev) projects, while you can also use it alone. +It reads the metadata of [PEP 621][2] format and coverts it to [Core metadata][3]. + +[1]: https://www.python.org/dev/peps/pep-0517/ +[2]: https://www.python.org/dev/peps/pep-0621/ +[3]: https://packaging.python.org/specifications/core-metadata/ + +## Use as PEP 517 build backend + +Edit your `pyproject.toml` as follows: + +```toml +[build-system] +requires = ["pdm-pep517"] +build-backend = "pdm.pep517.api" +``` + +## Tool specific settings + +Besides of the standard fields specified in PEP 621, PDM-PEP517 honors some other settings to change the build behavior. They should be defined under `[tool.pdm.build]` table: + +```toml +[tool.pdm.build] +# Specify where the Python packages live. +package-dir = "src" +# File patterns to include, the paths are relative to the project root. +includes = [] +# File patterns to exclude, the paths are relative to the project root. +excludes = [] +# File patterns to include in source distribution and exclude in wheel distribution. +source-includes = [] +# An extra script to populate the arguments of `setup()`, one can build C extensions with this script. Or a custom build() function to generate files. +setup-script = "build.py" +# If true, the setup-script will run in a generated `setup.py` file. +run-setuptools = false +# Override the Is-Purelib value in the wheel. +is-purelib = true +# Change the editable-backend: path(default) or editables +editable-backend = "editables" +``` + +You don't have to specify all of them, PDM-PEP517 can also derive these fields smartly, based on some best practices of Python packaging. + +## Dynamic project version + +`pdm-pep517` can also determine the version of the project dynamically. To do this, you need to leave the `version` field out from your `pyproject.toml` and add `dynamic = ["version"]`: + +```diff +[project] +... +- version = "0.1.0" remove this line ++ dynamic = ["version"] +``` + +Then in `[tool.pdm.version]` table, specify how to get the version info. There are two ways supported: + +1. Read from a static string in the given file path: + +```toml +[tool.pdm.version] +source = "file" +path = "mypackage/__init__.py" +``` + +In this way, the file MUST contain a line like: + +```python +__version__ = "0.1.0" # Single quotes and double quotes are both OK, comments are allowed. +``` + +2. Read from SCM tag, supporting `git` and `hg`: + +```toml +[tool.pdm.version] +source = "scm" +``` + +When building from a source tree where SCM is not available, you can use the env var `PDM_PEP517_SCM_VERSION` to pretend the version is set. + +```bash +PDM_PEP517_SCM_VERSION=0.1.0 python -m build +``` + +## Writing SCM version to file + +You can instruct PDM-PEP517 to write back the dynamic version fetched from SCM to a file: + +```toml +[tool.pdm.version] +source = "scm" +write_to = "foo/version.txt" +``` + +By default, PDM-PEP517 will just write the SCM version itself. +You can provide a template as a Python-formatted string to create a syntactically correct Python assignment: + +```toml +[tool.pdm.version] +source = "scm" +write_to = "foo/_version.py" +write_template = "__version__ = '{}'" +``` + +Note that PDM-PEP517 will rewrite the whole file each time, so you can't have additional contents in that file. + +## Custom Build Script + +With custom build script, you can call other tools to generates files to be included in the wheel. +Just set the `setup-script` field under `[tool.pdm.build]` table to the path of the script. + +In the script, you expose a function named `build`, which takes two arguments: + +- `src`(str): the path of the source directory +- `dst`(str): the path of the destination directory + +Example: + +```python + +def build(src, dst): + with open(os.path.join(dst, "myfile.txt"), "w") as f: + # Put a file in the wheel + f.write("Hello World!") +``` +Note that the generated file hierarchy will be preserved in the wheel: `$dst/myfile.txt` -> `$wheel_root/myfile.txt`. + +When `run-setuptools` is `true`, the `build` function will be called in a generated `setup.py` file, with the setup parameters as the only argument. + +Example: + +```python + +def build(setup_params): + # add ext_modules to the setup() arguments + setup_parms.update(ext_modules=[Extension("myextension", ["myextension.c"])]) +``` + +The will result in a `setup()` call like following: + +```python +setup( + name="mypackage", + # Other metadata fields + ext_modules=[Extension("myextension", ["myextension.c"])], +) +``` + +**By default, when `setup-script` is set, the resulted wheel will be platform-specific, but you can override this behavior by setting `is-purelib` to `false`** + +## Supported config settings + +`pdm-pep517` allows passing `config_settings` to modify the build behavior. It use the same option convention as `python setup.py bdist_wheel`. + +``` +--python-tag + Override the python implementation compatibility tag(e.g. cp37, py3, pp3) +--py-limited-api + Python tag (cp32|cp33|cpNN) for abi3 wheel tag +--plat-name + Override the platform name(e.g. win_amd64, manylinux2010_x86_64) +``` + +For example, you can supply these options with [build](https://pypi.org/project/build/): + +```bash +python -m build --sdist --wheel --outdir dist/ --config-setting="--python-tag=cp37" --config-setting="--plat-name=win_amd64" +``` + +`pip` doesn't support passing `config_settings` yet, please stick to `build` as the recommended frontend. + +## License + +This project is licensed under [MIT license](/LICENSE). + + + +%prep +%autosetup -n pdm-pep517-1.1.3 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-pdm-pep517 -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.3-1 +- Package Spec generated @@ -0,0 +1 @@ +a9fe9e77bf9eee69cda44fbc1437a13b pdm-pep517-1.1.3.tar.gz |