summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-17 03:07:41 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-17 03:07:41 +0000
commite0076ee64804cfc2af01bbb93bcd2d78158ec780 (patch)
tree7f3ba07b6fa75de0965f6ef14cbc8587efa4276f
parentd0268db6892b5a1c06b81c3760a51e8ba494fcf4 (diff)
automatic import of python-setup-cfg-fmt
-rw-r--r--.gitignore1
-rw-r--r--python-setup-cfg-fmt.spec505
-rw-r--r--sources1
3 files changed, 507 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..5271055 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/setup_cfg_fmt-2.2.0.tar.gz
diff --git a/python-setup-cfg-fmt.spec b/python-setup-cfg-fmt.spec
new file mode 100644
index 0000000..984bc63
--- /dev/null
+++ b/python-setup-cfg-fmt.spec
@@ -0,0 +1,505 @@
+%global _empty_manifest_terminate_build 0
+Name: python-setup-cfg-fmt
+Version: 2.2.0
+Release: 1
+Summary: apply a consistent format to `setup.cfg` files
+License: MIT
+URL: https://github.com/asottile/setup-cfg-fmt
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/37/eb/c51ed9c80c59b90a6b2666aaaddd3111b21e1efa1b1ac4397d86d6a3b881/setup_cfg_fmt-2.2.0.tar.gz
+BuildArch: noarch
+
+Requires: python3-identify[license]
+
+%description
+apply a consistent format to `setup.cfg` files
+## installation
+```bash
+pip install setup-cfg-fmt
+```
+## as a pre-commit hook
+See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions
+Sample `.pre-commit-config.yaml`:
+```yaml
+- repo: https://github.com/asottile/setup-cfg-fmt
+ rev: v2.2.0
+ hooks:
+ - id: setup-cfg-fmt
+```
+## cli
+Consult the help for the latest usage:
+```console
+$ setup-cfg-fmt --help
+usage: setup-cfg-fmt [-h] [filenames [filenames ...]]
+positional arguments:
+ filenames
+optional arguments:
+ -h, --help show this help message and exit
+```
+## what does it do?
+### sets a consistent ordering for attributes
+For example, `name` and `version` (the most important metadata) will always
+appear at the top.
+```diff
+ [metadata]
+-version = 1.14.4
+-name = pre_commit
++name = pre_commit
++version = 1.14.4
+```
+### normalizes dashes to underscores in project name
+- `pip` will normalize names to dashes `foo_bar` => `foo-bar`
+- `python setup.py sdist` produces a filename with the name verbatim
+- `pip wheel .` produces a filename with an underscore-normalized name
+```console
+$ # with dashed name
+$ python setup.py sdist && pip wheel -w dist .
+$ ls dist/ | cat
+setup_cfg_fmt-0.0.0-py2.py3-none-any.whl
+setup-cfg-fmt-0.0.0.tar.gz
+$ # with underscore name
+$ python setup.py sdist && pip wheel -w dist .
+$ ls dist/ | cat
+setup_cfg_fmt-0.0.0-py2.py3-none-any.whl
+setup_cfg_fmt-0.0.0.tar.gz
+```
+This makes it easier to upload packages to pypi since they end up with the
+same filename prefix.
+```diff
+ [metadata]
+-name = pre-commit
++name = pre_commit
+```
+### normalizes dashes to underscores in keys
+setuptools allows dashed names but does not document them.
+```diff
+ [metadata]
+ name = pre-commit
+-long-description = file: README.md
++long_description = file: README.md
+```
+### adds `long_description` if `README` is present
+This will show up on the pypi project page
+```diff
+ [metadata]
+ name = pre_commit
+ version = 1.14.5
++long_description = file: README.md
++long_description_content_type = text/markdown
+```
+### adds `license_file` / `license` / license classifier if `LICENSE` exists
+```diff
+ [metadata]
+ name = pre_commit
+ version = 1.14.5
++license = MIT
++license_file = LICENSE
++classifiers =
++ License :: OSI Approved :: MIT License
+```
+### set `python_requires`
+A few sources are searched for guessing `python_requires`:
+- the existing `python_requires` setting itself
+- `envlist` in `tox.ini` if present
+- python version `classifiers` that are already set
+- the `--min-py3-version` argument (currently defaulting to `3.7`)
+If the minimum version is detected as python2, the `--min-py3-version`
+argument will be used to exclude python3.x versions (see below).
+```diff
+ [options]
+ py_modules = pre_commit
++python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
+```
+### adds python version classifiers
+classifiers are generated based on:
+- the `python_requires` setting
+- the `--max-py-version` argument (currently defaulting to `3.11`)
+- `--include-version-classifiers` is specified
+```diff
+ name = pkg
+ version = 1.0
++classifiers =
++ Programming Language :: Python :: 2
++ Programming Language :: Python :: 2.7
++ Programming Language :: Python :: 3
++ Programming Language :: Python :: 3.7
++ Programming Language :: Python :: 3.8
++ Programming Language :: Python :: 3.9
++ Programming Language :: Python :: 3.10
++ Programming Language :: Python :: 3.11
+```
+without `--include-version-classifiers` only the major version will be included:
+```diff
+ name = pkg
+ version = 1.0
++classifiers =
++ Programming Language :: Python :: 2
++ Programming Language :: Python :: 3
+```
+### sorts classifiers
+```diff
+ [metadata]
+ name = pre_commit
+ version = 1.14.5
+ classifiers =
+- Programming Language :: Python :: 3
+- License :: OSI Approved :: MIT License
++ License :: OSI Approved :: MIT License
++ Programming Language :: Python :: 3
+ Programming Language :: Python :: 3.6
+```
+### removes empty options in any section
+```diff
+ [options]
+-dependency_links =
+ python_requires = >= 3.6.1
+```
+## related projects
+- [setup-py-upgrade]: automatically migrate `setup.py` -> `setup.cfg`
+[setup-py-upgrade]: https://github.com/asottile/setup-py-upgrade
+
+%package -n python3-setup-cfg-fmt
+Summary: apply a consistent format to `setup.cfg` files
+Provides: python-setup-cfg-fmt
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-setup-cfg-fmt
+apply a consistent format to `setup.cfg` files
+## installation
+```bash
+pip install setup-cfg-fmt
+```
+## as a pre-commit hook
+See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions
+Sample `.pre-commit-config.yaml`:
+```yaml
+- repo: https://github.com/asottile/setup-cfg-fmt
+ rev: v2.2.0
+ hooks:
+ - id: setup-cfg-fmt
+```
+## cli
+Consult the help for the latest usage:
+```console
+$ setup-cfg-fmt --help
+usage: setup-cfg-fmt [-h] [filenames [filenames ...]]
+positional arguments:
+ filenames
+optional arguments:
+ -h, --help show this help message and exit
+```
+## what does it do?
+### sets a consistent ordering for attributes
+For example, `name` and `version` (the most important metadata) will always
+appear at the top.
+```diff
+ [metadata]
+-version = 1.14.4
+-name = pre_commit
++name = pre_commit
++version = 1.14.4
+```
+### normalizes dashes to underscores in project name
+- `pip` will normalize names to dashes `foo_bar` => `foo-bar`
+- `python setup.py sdist` produces a filename with the name verbatim
+- `pip wheel .` produces a filename with an underscore-normalized name
+```console
+$ # with dashed name
+$ python setup.py sdist && pip wheel -w dist .
+$ ls dist/ | cat
+setup_cfg_fmt-0.0.0-py2.py3-none-any.whl
+setup-cfg-fmt-0.0.0.tar.gz
+$ # with underscore name
+$ python setup.py sdist && pip wheel -w dist .
+$ ls dist/ | cat
+setup_cfg_fmt-0.0.0-py2.py3-none-any.whl
+setup_cfg_fmt-0.0.0.tar.gz
+```
+This makes it easier to upload packages to pypi since they end up with the
+same filename prefix.
+```diff
+ [metadata]
+-name = pre-commit
++name = pre_commit
+```
+### normalizes dashes to underscores in keys
+setuptools allows dashed names but does not document them.
+```diff
+ [metadata]
+ name = pre-commit
+-long-description = file: README.md
++long_description = file: README.md
+```
+### adds `long_description` if `README` is present
+This will show up on the pypi project page
+```diff
+ [metadata]
+ name = pre_commit
+ version = 1.14.5
++long_description = file: README.md
++long_description_content_type = text/markdown
+```
+### adds `license_file` / `license` / license classifier if `LICENSE` exists
+```diff
+ [metadata]
+ name = pre_commit
+ version = 1.14.5
++license = MIT
++license_file = LICENSE
++classifiers =
++ License :: OSI Approved :: MIT License
+```
+### set `python_requires`
+A few sources are searched for guessing `python_requires`:
+- the existing `python_requires` setting itself
+- `envlist` in `tox.ini` if present
+- python version `classifiers` that are already set
+- the `--min-py3-version` argument (currently defaulting to `3.7`)
+If the minimum version is detected as python2, the `--min-py3-version`
+argument will be used to exclude python3.x versions (see below).
+```diff
+ [options]
+ py_modules = pre_commit
++python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
+```
+### adds python version classifiers
+classifiers are generated based on:
+- the `python_requires` setting
+- the `--max-py-version` argument (currently defaulting to `3.11`)
+- `--include-version-classifiers` is specified
+```diff
+ name = pkg
+ version = 1.0
++classifiers =
++ Programming Language :: Python :: 2
++ Programming Language :: Python :: 2.7
++ Programming Language :: Python :: 3
++ Programming Language :: Python :: 3.7
++ Programming Language :: Python :: 3.8
++ Programming Language :: Python :: 3.9
++ Programming Language :: Python :: 3.10
++ Programming Language :: Python :: 3.11
+```
+without `--include-version-classifiers` only the major version will be included:
+```diff
+ name = pkg
+ version = 1.0
++classifiers =
++ Programming Language :: Python :: 2
++ Programming Language :: Python :: 3
+```
+### sorts classifiers
+```diff
+ [metadata]
+ name = pre_commit
+ version = 1.14.5
+ classifiers =
+- Programming Language :: Python :: 3
+- License :: OSI Approved :: MIT License
++ License :: OSI Approved :: MIT License
++ Programming Language :: Python :: 3
+ Programming Language :: Python :: 3.6
+```
+### removes empty options in any section
+```diff
+ [options]
+-dependency_links =
+ python_requires = >= 3.6.1
+```
+## related projects
+- [setup-py-upgrade]: automatically migrate `setup.py` -> `setup.cfg`
+[setup-py-upgrade]: https://github.com/asottile/setup-py-upgrade
+
+%package help
+Summary: Development documents and examples for setup-cfg-fmt
+Provides: python3-setup-cfg-fmt-doc
+%description help
+apply a consistent format to `setup.cfg` files
+## installation
+```bash
+pip install setup-cfg-fmt
+```
+## as a pre-commit hook
+See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions
+Sample `.pre-commit-config.yaml`:
+```yaml
+- repo: https://github.com/asottile/setup-cfg-fmt
+ rev: v2.2.0
+ hooks:
+ - id: setup-cfg-fmt
+```
+## cli
+Consult the help for the latest usage:
+```console
+$ setup-cfg-fmt --help
+usage: setup-cfg-fmt [-h] [filenames [filenames ...]]
+positional arguments:
+ filenames
+optional arguments:
+ -h, --help show this help message and exit
+```
+## what does it do?
+### sets a consistent ordering for attributes
+For example, `name` and `version` (the most important metadata) will always
+appear at the top.
+```diff
+ [metadata]
+-version = 1.14.4
+-name = pre_commit
++name = pre_commit
++version = 1.14.4
+```
+### normalizes dashes to underscores in project name
+- `pip` will normalize names to dashes `foo_bar` => `foo-bar`
+- `python setup.py sdist` produces a filename with the name verbatim
+- `pip wheel .` produces a filename with an underscore-normalized name
+```console
+$ # with dashed name
+$ python setup.py sdist && pip wheel -w dist .
+$ ls dist/ | cat
+setup_cfg_fmt-0.0.0-py2.py3-none-any.whl
+setup-cfg-fmt-0.0.0.tar.gz
+$ # with underscore name
+$ python setup.py sdist && pip wheel -w dist .
+$ ls dist/ | cat
+setup_cfg_fmt-0.0.0-py2.py3-none-any.whl
+setup_cfg_fmt-0.0.0.tar.gz
+```
+This makes it easier to upload packages to pypi since they end up with the
+same filename prefix.
+```diff
+ [metadata]
+-name = pre-commit
++name = pre_commit
+```
+### normalizes dashes to underscores in keys
+setuptools allows dashed names but does not document them.
+```diff
+ [metadata]
+ name = pre-commit
+-long-description = file: README.md
++long_description = file: README.md
+```
+### adds `long_description` if `README` is present
+This will show up on the pypi project page
+```diff
+ [metadata]
+ name = pre_commit
+ version = 1.14.5
++long_description = file: README.md
++long_description_content_type = text/markdown
+```
+### adds `license_file` / `license` / license classifier if `LICENSE` exists
+```diff
+ [metadata]
+ name = pre_commit
+ version = 1.14.5
++license = MIT
++license_file = LICENSE
++classifiers =
++ License :: OSI Approved :: MIT License
+```
+### set `python_requires`
+A few sources are searched for guessing `python_requires`:
+- the existing `python_requires` setting itself
+- `envlist` in `tox.ini` if present
+- python version `classifiers` that are already set
+- the `--min-py3-version` argument (currently defaulting to `3.7`)
+If the minimum version is detected as python2, the `--min-py3-version`
+argument will be used to exclude python3.x versions (see below).
+```diff
+ [options]
+ py_modules = pre_commit
++python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
+```
+### adds python version classifiers
+classifiers are generated based on:
+- the `python_requires` setting
+- the `--max-py-version` argument (currently defaulting to `3.11`)
+- `--include-version-classifiers` is specified
+```diff
+ name = pkg
+ version = 1.0
++classifiers =
++ Programming Language :: Python :: 2
++ Programming Language :: Python :: 2.7
++ Programming Language :: Python :: 3
++ Programming Language :: Python :: 3.7
++ Programming Language :: Python :: 3.8
++ Programming Language :: Python :: 3.9
++ Programming Language :: Python :: 3.10
++ Programming Language :: Python :: 3.11
+```
+without `--include-version-classifiers` only the major version will be included:
+```diff
+ name = pkg
+ version = 1.0
++classifiers =
++ Programming Language :: Python :: 2
++ Programming Language :: Python :: 3
+```
+### sorts classifiers
+```diff
+ [metadata]
+ name = pre_commit
+ version = 1.14.5
+ classifiers =
+- Programming Language :: Python :: 3
+- License :: OSI Approved :: MIT License
++ License :: OSI Approved :: MIT License
++ Programming Language :: Python :: 3
+ Programming Language :: Python :: 3.6
+```
+### removes empty options in any section
+```diff
+ [options]
+-dependency_links =
+ python_requires = >= 3.6.1
+```
+## related projects
+- [setup-py-upgrade]: automatically migrate `setup.py` -> `setup.cfg`
+[setup-py-upgrade]: https://github.com/asottile/setup-py-upgrade
+
+%prep
+%autosetup -n setup-cfg-fmt-2.2.0
+
+%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-setup-cfg-fmt -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 17 2023 Python_Bot <Python_Bot@openeuler.org> - 2.2.0-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..814050e
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+c19d4f07f37cd355c1a1e9bdc1d0a4cd setup_cfg_fmt-2.2.0.tar.gz