未验证 提交 ad82aad8 编写于 作者: F frostming

Update README.md

上级 85aff9f9
......@@ -34,9 +34,9 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
python -m pdm install -d
python -m pip install pdm
pdm install -d
- name: Test
run: |
python -m pdm run pytest --cov pdm tests
pdm run pytest --cov pdm tests
......@@ -16,7 +16,16 @@ you can probably find some goodness in `pdm`.
## Installation:
> It is still a WIP project and not published to PyPI.
```bash
$ pipx install pdm
```
It is recommended to install `pdm` in an isolated enviroment, with `pipx`.
Or you can install it under user site:
```bash
$ pip install --user pdm
```
## Usage
......@@ -32,7 +41,7 @@ you can probably find some goodness in `pdm`.
- [x] Console scripts are injected with local paths.
- [x] A neet CLI.
- [x] `add`, `lock`, `list`, `update`, `remove` commands.
- [ ] PEP 517 build backends.
- [x] PEP 517 build backends.
- [x] Continuous Integration.
......
......@@ -46,7 +46,6 @@ Version: {version}
Summary: {description}
Home-page: {homepage}
License: {license}
Description: {readme}
"""
......@@ -292,12 +291,14 @@ class Builder:
for classifier in meta.classifiers or []:
content += "Classifier: {}\n".format(classifier)
for extra in sorted(meta._extras or []):
content += "Provides-Extra: {}\n".format(extra)
for dep in sorted(meta.install_requires):
content += "Requires-Dist: {}\n".format(dep)
for extra, reqs in sorted(self.meta.requires_extra.items()):
content += "Provides-Extra: {}\n".format(extra)
for dep in reqs:
content += "Requires-Dist: {}\n".format(dep)
for url in sorted(meta.project_urls or {}):
content += "Project-URL: {}, {}\n".format(url, meta.project_urls[url])
......@@ -306,6 +307,9 @@ class Builder:
meta.long_description_content_type
)
if meta.readme:
content += "\n" + Path(meta.readme).read_text("utf-8") + "\n"
return content
def ensure_setup_py(self) -> None:
......
......@@ -10,6 +10,7 @@ import vistir
from pkg_resources import safe_name
from pdm.exceptions import ProjectError
from pdm.models.markers import Marker
if TYPE_CHECKING:
from pdm.project import Project
......@@ -90,6 +91,18 @@ class PackageMeta:
for extra in self._extras
}
@property
def requires_extra(self) -> Dict[str, List[str]]:
if not self._extras:
return {}
result = {}
for extra in self._extras:
current = result[extra] = []
for r in self.project.get_dependencies(extra).values():
r.marker = Marker(f"extra == {extra!r}") & r.marker
current.append(r.as_line())
return result
@property
def python_requires(self) -> str:
return str(self.project.python_requires)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册