-
-
Notifications
You must be signed in to change notification settings - Fork 680
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔧 Refactor package manager, move from Flit to PDM, remove private pip…
… extras for `test`, `doc`, `dev` (#764)
- Loading branch information
Showing
8 changed files
with
124 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,17 +9,33 @@ jobs: | |
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Dump GitHub context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
# Issue ref: https://github.com/actions/setup-python/issues/436 | ||
# cache: "pip" | ||
# cache-dependency-path: pyproject.toml | ||
- uses: actions/cache@v3 | ||
id: cache | ||
with: | ||
python-version: "3.7" | ||
- name: Install Flit | ||
run: pip install flit | ||
- name: Install Dependencies | ||
run: flit install --symlink | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} | ||
- name: Install build dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: pip install build | ||
- name: Build distribution | ||
run: python -m build | ||
- name: Publish | ||
uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
- name: Dump GitHub context | ||
env: | ||
FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }} | ||
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }} | ||
run: bash scripts/publish.sh | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: echo "$GITHUB_CONTEXT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
[build-system] | ||
requires = ["flit_core >=2,<3"] | ||
build-backend = "flit_core.buildapi" | ||
requires = ["pdm-backend"] | ||
build-backend = "pdm.backend" | ||
|
||
[tool.flit.metadata] | ||
module = "typer" | ||
author = "Sebastián RamÃrez" | ||
author-email = "[email protected]" | ||
home-page = "https://github.com/tiangolo/typer" | ||
[project] | ||
name = "typer" | ||
dynamic = ["version"] | ||
description = "Typer, build great CLIs. Easy to code. Based on Python type hints." | ||
authors = [ | ||
{name = "Sebastián RamÃrez", email = "[email protected]"}, | ||
] | ||
readme = "README.md" | ||
requires-python = ">=3.7" | ||
classifiers = [ | ||
"Intended Audience :: Information Technology", | ||
"Intended Audience :: System Administrators", | ||
|
@@ -26,49 +30,27 @@ classifiers = [ | |
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"License :: OSI Approved :: MIT License" | ||
] | ||
requires = [ | ||
"License :: OSI Approved :: MIT License", | ||
] | ||
dependencies = [ | ||
"click >= 8.0.0", | ||
"typing-extensions >= 3.7.4.3", | ||
] | ||
description-file = "README.md" | ||
requires-python = ">=3.7" | ||
|
||
[tool.flit.metadata.urls] | ||
[project.urls] | ||
Documentation = "https://typer.tiangolo.com/" | ||
homepage = "https://github.com/tiangolo/typer" | ||
|
||
[tool.flit.metadata.requires-extra] | ||
test = [ | ||
"shellingham >=1.3.0,<2.0.0", | ||
"pytest >=4.4.0,<8.0.0", | ||
"pytest-cov >=2.10.0,<5.0.0", | ||
"coverage >=6.2,<7.0", | ||
"pytest-xdist >=1.32.0,<4.0.0", | ||
"pytest-sugar >=0.9.4,<0.10.0", | ||
"mypy ==0.971", | ||
"black >=22.3.0,<23.0.0", | ||
"isort >=5.0.6,<6.0.0", | ||
"rich >=10.11.0,<14.0.0", | ||
] | ||
doc = [ | ||
"mkdocs >=1.1.2,<2.0.0", | ||
"mkdocs-material >=8.1.4,<9.0.0", | ||
"mdx-include >=1.4.1,<2.0.0", | ||
"pillow >=9.3.0,<10.0.0", | ||
"cairosvg >=2.5.2,<3.0.0", | ||
] | ||
dev = [ | ||
"autoflake >=1.3.1,<2.0.0", | ||
"flake8 >=3.8.3,<4.0.0", | ||
"pre-commit >=2.17.0,<3.0.0", | ||
] | ||
[project.optional-dependencies] | ||
all = [ | ||
"colorama >=0.4.3,<0.5.0", | ||
"shellingham >=1.3.0,<2.0.0", | ||
"rich >=10.11.0,<14.0.0", | ||
] | ||
|
||
[tool.pdm] | ||
version = { source = "file", path = "typer/__init__.py" } | ||
|
||
[tool.isort] | ||
profile = "black" | ||
known_third_party = ["typer", "click"] | ||
|
@@ -89,7 +71,6 @@ filterwarnings = [ | |
"error", | ||
# TODO: until I refactor completion to use the new shell_complete | ||
"ignore:'autocompletion' is renamed to 'shell_complete'. The old name is deprecated and will be removed in Click 8.1. See the docs about 'Parameter' for information about new behavior.:DeprecationWarning:typer", | ||
'ignore:starlette.middleware.wsgi is deprecated and will be removed in a future release\..*:DeprecationWarning:starlette', | ||
# For pytest-xdist | ||
'ignore::DeprecationWarning:xdist', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-e . | ||
|
||
mkdocs-material==9.4.7 | ||
mdx-include >=1.4.1,<2.0.0 | ||
mkdocs-markdownextradata-plugin >=0.1.7,<0.3.0 | ||
mkdocs-redirects>=1.2.1,<1.3.0 | ||
pyyaml >=5.3.1,<7.0.0 | ||
# For Material for MkDocs, Chinese search | ||
jieba==0.42.1 | ||
# For image processing by Material for MkDocs | ||
pillow==10.1.0 | ||
# For image processing by Material for MkDocs | ||
cairosvg==2.7.0 | ||
mkdocstrings[python]==0.23.0 | ||
griffe-typingdoc==0.2.2 | ||
# For griffe, it formats with black | ||
black==23.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-e .[all] | ||
|
||
pytest >=4.4.0,<8.0.0 | ||
pytest-cov >=2.10.0,<5.0.0 | ||
coverage[toml] >=6.2,<7.0 | ||
pytest-xdist >=1.32.0,<4.0.0 | ||
pytest-sugar >=0.9.4,<0.10.0 | ||
mypy ==0.971 | ||
black >=22.3.0,<23.0.0 | ||
isort >=5.0.6,<6.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-e .[all] | ||
|
||
-r requirements-tests.txt | ||
-r requirements-docs.txt | ||
|
||
pre-commit >=2.17.0,<4.0.0 |