Rename src_py3 to src (#965)

This commit is contained in:
Adam Turner 2021-11-25 23:29:03 +00:00 committed by GitHub
parent 28b64f4fea
commit caa9cdf5d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 79 additions and 12 deletions

View File

@ -12,4 +12,4 @@ ignore =
exclude =
# tests have more relaxed formatting rules
# and its own specific config in .flake8-tests
typing_extensions/src_py3/test_typing_extensions.py,
typing_extensions/src/test_typing_extensions.py,

View File

@ -30,7 +30,7 @@ jobs:
run: |
# Be wary of running `pip install` here, since it becomes easy for us to
# accidentally pick up typing_extensions as installed by a dependency
cd typing_extensions/src_py3
cd typing_extensions/src
python -m unittest test_typing_extensions.py
linting:
@ -63,4 +63,4 @@ jobs:
run: flake8
- name: Lint tests
run: flake8 --config=.flake8-tests typing_extensions/src_py3/test_typing_extensions.py
run: flake8 --config=.flake8-tests typing_extensions/src/test_typing_extensions.py

71
.github/workflows/package.yml vendored Normal file
View File

@ -0,0 +1,71 @@
name: Test packaging
on:
push:
pull_request:
permissions:
contents: read
jobs:
wheel:
name: Test wheel install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3
- name: Install pypa/build
run: |
# Be wary of running `pip install` here, since it becomes easy for us to
# accidentally pick up typing_extensions as installed by a dependency
python -m pip install --upgrade build
python -m pip list
- name: Build and install wheel
run: |
cd typing_extensions
python -m build .
export path_to_file=$(find dist -type f -name "typing_extensions-*.whl")
echo "::notice::Installing wheel: $path_to_file"
pip install -vvv $path_to_file
python -m pip list
- name: Attempt to import typing_extensions
run: python -c "import typing_extensions; print(typing_extensions.__all__)"
sdist:
name: Test sdist install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3
- name: Install pypa/build
run: |
# Be wary of running `pip install` here, since it becomes easy for us to
# accidentally pick up typing_extensions as installed by a dependency
python -m pip install --upgrade build
python -m pip list
- name: Build and install sdist
run: |
cd typing_extensions
python -m build .
export path_to_file=$(find dist -type f -name "typing_extensions-*.tar.gz")
echo "::notice::Installing sdist: $path_to_file"
pip install -vvv $path_to_file
python -m pip list
- name: Attempt to import typing_extensions
run: python -c "import typing_extensions; print(typing_extensions.__all__)"

View File

@ -34,10 +34,10 @@ backwards-incompatible changes.
- Build the source and wheel distributions:
- `pip3 install -U flit`
- `python -m pip install --upgrade build`
- `cd typing_extensions`
- `rm -rf dist/`
- `flit build --no-setup-py`
- `python -m build .`
- Install the built distributions locally and test (if you were using `tox`, you already
tested the source distribution).

View File

@ -1,3 +1,3 @@
include CHANGELOG LICENSE README.rst
include src_py3/typing_extensions.py
include src_py3/test_typing_extensions.py
include src/typing_extensions.py
include src/test_typing_extensions.py

View File

@ -61,7 +61,3 @@ classifiers = [
[[project.authors]]
name = "Guido van Rossum, Jukka Lehtosalo, Łukasz Langa, Michael Lee"
email = "levkivskyi@gmail.com"
# This tells Flit that the module is stored in the src_py3 directory.
[tool.flit.module]
name = "src_py3/typing_extensions"

View File

@ -2,5 +2,5 @@
envlist = py36, py37, py38, py39
[testenv]
changedir = src_py3
changedir = src
commands = python -m unittest discover