Skip to content

Commit

Permalink
Rename src_py3 to src (python#965)
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner authored and srittau committed Dec 2, 2021
1 parent ad64544 commit 67992d9
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -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,
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 changes: 71 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -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__)"
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 2 additions & 2 deletions typing_extensions/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions typing_extensions/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,3 @@ classifiers = [
[[project.authors]]
name = "Guido van Rossum, Jukka Lehtosalo, Łukasz Langa, Michael Lee"
email = "[email protected]"

# This tells Flit that the module is stored in the src_py3 directory.
[tool.flit.module]
name = "src_py3/typing_extensions"
File renamed without changes.
2 changes: 1 addition & 1 deletion typing_extensions/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
envlist = py36, py37, py38, py39

[testenv]
changedir = src_py3
changedir = src
commands = python -m unittest discover

0 comments on commit 67992d9

Please sign in to comment.