8000 Switch to standard pep517 sdist generation · pytorch/pytorch@36a487f · GitHub
[go: up one dir, main page]

Skip to content

Commit 36a487f

Browse files
committed
Switch to standard pep517 sdist generation
ghstack-source-id: a299d4a Pull Request resolved: #152098
1 parent 3849fd1 commit 36a487f

File tree

2 files changed

+99
-34
lines changed

2 files changed

+99
-34
lines changed

.github/workflows/create_release.yml

+35-13
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
contents: write
3636
outputs:
3737
pt_release_name: ${{ steps.release_name.outputs.pt_release_name }}
38+
pt_pep517_release_name: ${{ steps.release_name.outputs.pt_pep517_release_name }}
3839
steps:
3940
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4041
with:
@@ -55,32 +56,48 @@ jobs:
5556
tag_or_branch="${tag_or_branch//\//_}"
5657
echo "PT_RELEASE_NAME=pytorch-$tag_or_branch" >> "$GITHUB_ENV"
5758
echo "PT_RELEASE_FILE=pytorch-$tag_or_branch.tar.gz" >> "$GITHUB_ENV"
59+
echo "PT_PEP517_RELEASE_FILE=torch-$tag_or_branch.tar.gz" >> "$GITHUB_ENV"
5860
- name: Create source distribution
5961
run: |
60-
# Create new folder with specified name so extracting the archive yields that
61-
rm -rf "/tmp/$PT_RELEASE_NAME"
62-
cp -r "$PWD" "/tmp/$PT_RELEASE_NAME"
63-
mv "/tmp/$PT_RELEASE_NAME" .
64-
# Cleanup
65-
rm -rf "$PT_RELEASE_NAME"/{.circleci,.ci}
66-
find "$PT_RELEASE_NAME" -name '.git*' -exec rm -rv {} \; || true
67-
# Create archive
68-
tar -czf "$PT_RELEASE_FILE" "$PT_RELEASE_NAME"
69-
echo "Created source archive $PT_RELEASE_FILE with content: $(ls -a "$PT_RELEASE_NAME")"
62+
# Create new folder with specified name so extracting the archive yields that
63+
rm -rf "/tmp/$PT_RELEASE_NAME"
64+
cp -r "$PWD" "/tmp/$PT_RELEASE_NAME"
65+
mv "/tmp/$PT_RELEASE_NAME" .
66+
# Cleanup
67+
rm -rf "$PT_RELEASE_NAME"/{.circleci,.ci}
68+
find "$PT_RELEASE_NAME" -name '.git*' -exec rm -rv {} \; || true
69+
# Create archive
70+
tar -czf "$PT_RELEASE_FILE" "$PT_RELEASE_NAME"
71+
echo "Created source archive $PT_RELEASE_FILE with content: $(ls -a "$PT_RELEASE_NAME")"
72+
- name: Create PEP 517 compatible source distribution
73+
run: |
74+
pip install build==1.2.2.post1 || exit 1
75+
python -m build --sdist || exit 1
76+
cd dist || exit 1
7077
- name: Upload source distribution for release
7178
if: ${{ github.event_name == 'release' }}
7279
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
7380
with:
74-
files: ${{env.PT_RELEASE_FILE}}
81+
files:
82+
- ${{ env.PT_RELEASE_FILE }}
83+
- ${{ env.PT_PEP517_RELEASE_FILE }}
7584
- name: Upload source distribution to GHA artifacts for release tags
7685
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'rc') }}
7786
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
7887
with:
7988
name: ${{ env.PT_RELEASE_FILE }}
8089
path: ${{ env.PT_RELEASE_FILE }}
90+
- name: Upload PEP 517 source distribution to GHA artifacts for release tags
91+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'rc') }}
92+
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
93+
with:
94+
name: ${{ env.PT_PEP517_RELEASE_FILE }}
95+
path: ${{ env.PT_PEP517_RELEASE_FILE }}
8196
- name: Set output
8297
id: release_name
83-
run: echo "name=pt_release_name::${{ env.PT_RELEASE_NAME }}.tar.gz" >> "${GITHUB_OUTPUT}"
98+
run: |
99+
echo "name=pt_release_name::${{ env.PT_RELEASE_FILE }}" >> "${GITHUB_OUTPUT}"
100+
echo "name=pt_pep517_release_name::${{ env.PT_PEP517_RELEASE_FILE }}" >> "${GITHUB_OUTPUT}"
84101
85102
upload_source_code_to_s3:
86103
if: ${{ github.repository == 'pytorch/pytorch' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'rc') }}
@@ -96,6 +113,9 @@ jobs:
96113
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
97114
with:
98115
name: ${{ needs.release.outputs.pt_release_name }}
116+
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
117+
with:
118+
name: ${{ needs.release.outputs.pt_pep517_release_name }}
99119
- name: Configure AWS credentials(PyTorch account)
100120
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
101121
with:
@@ -106,7 +126,9 @@ jobs:
106126
s3-bucket: pytorch
107127
s3-prefix: source_code/test
108128
if-no-files-found: warn
109-
path: ${{ needs.release.outputs.pt_release_name }}
129+
path: |
130+
${{ needs.release.outputs.pt_release_name }}
131+
${{ needs.release.outputs.pt_pep517_release_name }}
110132
111133
concurrency:
112134
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name }}

MANIFEST.in

+64-21
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,74 @@
11
include MANIFEST.in
2+
include BUCK.oss
3+
include BUILD.bazel
24
include CMakeLists.txt
35
include CITATION.cff
6+
include CODE_OF_CONDUCT.md
7+
include CODEOWNERS
8+
include CONTRIBUTING.md
9+
include Dockerfile
10+
include GLOSSARY.md
411
include LICENSE
12+
include Makefile
513
include NOTICE
6-
include .gitmodules
7-
include build_variables.bzl
14+
include RELEASE.md
15+
include SECURITY.md
16+
include WORKSPACE
17+
include *.bzl
18+
include docker.Makefile
819
include mypy.ini
20+
include mypy-strict.ini
21+
include pytest.ini
922
include requirements.txt
23+
include ubsan.supp
1024
include ufunc_defs.bzl
1125
include version.txt
12-
recursive-include android *.*
13-
recursive-include aten *.*
14-
recursive-include binaries *.*
15-
recursive-include c10 *.*
16-
recursive-include caffe2 *.*
17-
recursive-include cmake *.*
18-
recursive-include torch *.*
19-
recursive-include tools *.*
20-
recursive-include test *.*
21-
recursive-include docs *.*
22-
recursive-include ios *.*
23-
recursive-include third_party *
24-
recursive-include test *.*
25-
recursive-include benchmarks *.*
26-
recursive-include scripts *.*
27-
recursive-include mypy_plugins *.*
28-
recursive-include modules *.*
29-
recursive-include functorch *.*
26+
include .bazelignore .bazelrc .bazelversion
27+
include .clang-format .clang-tidy
28+
include .cmakelintrc
29+
include .coveragerc
30+
include .ctags.d/*.ctags
31+
include .dockerignore
32+
include .flake8
33+
include .gdbinit
34+
include .lintrunner.toml
35+
include .lldbinit
36+
graft .devcontainer
37+
graft .vscode
38+
graft android
39+
graft aten
40+
graft binaries
41+
graft c10
42+
graft caffe2
43+
graft cmake
44+
graft torch
45+
graft tools
46+
graft test
47+
graft docs
48+
graft ios
49+
graft third_party
50+
graft test
51+
graft benchmarks
52+
graft scripts
53+
graft mypy_plugins
54+
graft modules
55+
graft functorch
56+
graft torchgen
57+
# ittapi contains a circular symlink; the following line deals with that
58+
# prune third_party/ittapi/rust/ittapi-sys/c-library
59+
# include third_party/ittapi/rust/ittapi-sys/c-library
60+
# prune third_party/ittapi/rust/ittapi-sys/LICENSES
61+
# include third_party/ittapi/rust/ittapi-sys/LICENSES
62+
exclude third_party/ittapi/rust/ittapi-sys/c-library/*
63+
prune third_party/flatbuffers/java/src/test/java/*
64+
prune third_party/flatbuffers/kotlin/benchmark/src/jvmMain/java/*
65+
recursive-include third_party/flatbuffers/java/src/main *
66+
recursive-include third_party/flatbuffers/tests *.cs *.fbs *.go *.h *.java *.json *.kt *lua *.nim *.php *.py *.rs
67+
prune torchgen/packaged
3068
prune */__pycache__
31-
global-exclude *.o *.so *.dylib *.a .git *.pyc *.swp
69+
prune **/.github
70+
prune **/.gitlab
71+
global-exclude *.o *.so *.dylib *.a
72+
global-exclude *.pyc *.swp
73+
global-exclude .git .git-blame-ignore-revs .gitattributes .gitignore .gitmodules
74+
global-exclude .gitlab-ci.yml

0 commit comments

Comments
 (0)
0