Skip to content

Commit

Permalink
Move source subdir (#24)
Browse files Browse the repository at this point in the history
* Use poetry-core as the build backend.

poetry has been split into poetry and poetry-core.  The core is a small
subset of functionality that is what is necessary to build python
packages.  Changing from poetry to poetry-core should improve the
`pip install antsibull` experience since all of poetry and its
dependencis won't be needed.

The update to a newer version is also needed to solve:

> python-poetry/poetry#2450

and allow us to put the source in a subdirectory

* Move source of ansibulled to a subdir.

pyre prefers to be given the directory which holds your python package
as the source-directory rather than the directory which is your python
package.  However, if the directory given is the toplevel, pyre tends to
get slow for me.  (I believe since it scans temporary directories that
I have accumulated [downloads of all those ansible collections...]).
Putting the source code in its own subdirectory is the way to fix that.

* Change the source dir path in github workflows too
  • Loading branch information
abadger authored Nov 15, 2021
1 parent f047625 commit 430bd7b
Show file tree
Hide file tree
Showing 116 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/antsibull-lint-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:

- name: antsibull-lint collection-docs
run: |
coverage run -p --source antsibull -m antsibull.cli.antsibull_lint collection-docs community.general
coverage run -p --source src/antsibull -m antsibull.cli.antsibull_lint collection-docs community.general
- name: antsibull-lint changelog-yaml
run: |
coverage run -p --source antsibull -m antsibull.cli.antsibull_lint changelog-yaml community.general/changelogs/changelog.yaml
coverage run -p --source src/antsibull -m antsibull.cli.antsibull_lint changelog-yaml community.general/changelogs/changelog.yaml
- name: Combine and upload coverage stats
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-css.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
- name: Build CSS
run: |
./build.sh
working-directory: ./sphinx_antsibull_ext/css
working-directory: ./src/sphinx_antsibull_ext/css
6 changes: 3 additions & 3 deletions .github/workflows/build-simple-docsite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
- name: Use antsibull-docs sphinx-init
run: |
coverage run -p --source antsibull -m antsibull.cli.antsibull_docs sphinx-init --use-current --lenient --dest-dir .
coverage run -p --source src/antsibull -m antsibull.cli.antsibull_docs sphinx-init --use-current --lenient --dest-dir .
- name: Patch build.sh to supply code coverage
run: |
sed -i build.sh -e 's/antsibull-docs /coverage run -p --source antsibull -m antsibull.cli.antsibull_docs /g'
sed -i build.sh -e 's/sphinx-build /coverage run -p --source antsibull --source sphinx_antsibull_ext -m sphinx.cmd.build /g'
sed -i build.sh -e 's!antsibull-docs !coverage run -p --source src/antsibull -m antsibull.cli.antsibull_docs !g'
sed -i build.sh -e 's!sphinx-build !coverage run -p --source src/antsibull --source src/sphinx_antsibull_ext -m sphinx.cmd.build !g'
- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion lint-flake8.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -e
poetry run flake8 antsibull sphinx_antsibull_ext --count --max-complexity=10 --max-line-length=100 --statistics "$@"
poetry run flake8 src/antsibull src/sphinx_antsibull_ext --count --max-complexity=10 --max-line-length=100 --statistics "$@"
2 changes: 1 addition & 1 deletion lint-mypy.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -e
MYPYPATH=stubs/ poetry run mypy antsibull sphinx_antsibull_ext "$@"
MYPYPATH=stubs/ poetry run mypy src/antsibull sphinx_antsibull_ext "$@"
2 changes: 1 addition & 1 deletion lint-pylint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -e
poetry run pylint --rcfile .pylintrc.automated antsibull sphinx_antsibull_ext "$@"
poetry run pylint --rcfile .pylintrc.automated src/antsibull sphinx_antsibull_ext "$@"
2 changes: 1 addition & 1 deletion lint-pyre.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ set -e

PURELIB=$(poetry run python -c 'from distutils.sysconfig import get_python_lib;print(get_python_lib(0))')
PLATLIB=$(poetry run python -c 'from distutils.sysconfig import get_python_lib;print(get_python_lib(1))')
poetry run pyre --source-directory antsibull --source-directory sphinx_antsibull_ext --search-path "$PURELIB" --search-path "$PLATLIB" --search-path stubs/ --search-path . "$@"
poetry run pyre --source-directory src --search-path "$PURELIB" --search-path "$PLATLIB" --search-path stubs/ "$@"
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
requires = ["poetry-core>=1.0.7"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "antsibull"
Expand All @@ -11,8 +11,8 @@ license = "GPL-3.0-or-later"
readme = "README.md"
repository = "https://github.com/ansible-community/antsibull"
packages = [
{ include = "antsibull" },
{ include = "sphinx_antsibull_ext" },
{ include = "antsibull", from="src" },
{ include = "sphinx_antsibull_ext", from="src" },
{ include = "tests", format = "sdist" }
]
classifiers = [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test-pytest.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
set -e
poetry run python -W 'ignore:"@coroutine" decorator is deprecated::asynctest.case' \
PYTHONPATH=src poetry run python -W 'ignore:"@coroutine" decorator is deprecated::asynctest.case' \
-m pytest --cov-branch --cov=antsibull --cov=sphinx_antsibull_ext --cov-report term-missing -vv tests "$@"

0 comments on commit 430bd7b

Please sign in to comment.