Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PyPI deploy. #2364

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Check Packaging
uses: pantsbuild/actions/run-tox@b16b9cf47cd566acfe217b1dafc5b452e27e6fd7
with:
tox-env: package -- --additional-format sdist --additional-format wheel --embed-docs
tox-env: package -- --additional-format sdist --additional-format wheel --embed-docs --clean-docs
- name: Check Docs
uses: pantsbuild/actions/run-tox@b16b9cf47cd566acfe217b1dafc5b452e27e6fd7
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Build sdist and wheel
uses: pantsbuild/actions/run-tox@b16b9cf47cd566acfe217b1dafc5b452e27e6fd7
with:
tox-env: package -- --no-pex --additional-format sdist --additional-format wheel --embed-docs
tox-env: package -- --no-pex --additional-format sdist --additional-format wheel --embed-docs --clean-docs
- name: Publish Pex ${{ needs.determine-tag.outputs.release-tag }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
11 changes: 11 additions & 0 deletions scripts/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def main(
*additional_dist_formats: Format,
verbosity: int = 0,
embed_docs: bool = False,
clean_docs: bool = False,
pex_output_file: Optional[Path] = DIST_DIR / "pex",
serve: bool = False
) -> None:
Expand Down Expand Up @@ -160,6 +161,9 @@ def main(
for dist_path in built:
print(f" {dist_path}")

if clean_docs:
shutil.rmtree(DIST_DIR / "docs", ignore_errors=True)

if serve:
server = HTTPServer(("", 0), SimpleHTTPRequestHandler)
host, port = server.server_address
Expand All @@ -184,6 +188,12 @@ def main(
action="store_true",
help="Embed offline docs in the built binary distributions.",
)
parser.add_argument(
"--clean-docs",
default=False,
action="store_true",
help="Clean up loose generated docs after they have embedded in binary distributions.",
)
parser.add_argument(
"--additional-format",
dest="additional_formats",
Expand Down Expand Up @@ -216,6 +226,7 @@ def main(
*(args.additional_formats or ()),
verbosity=args.verbosity,
embed_docs=args.embed_docs,
clean_docs=args.clean_docs,
pex_output_file=None if args.no_pex else args.pex_output_file,
serve=args.serve
)
Loading