tensorneko-lib 0.3.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. tensorneko_lib-0.3.11/.github/workflows/release-lib.yml +149 -0
  2. tensorneko_lib-0.3.11/.github/workflows/release.yml +266 -0
  3. tensorneko_lib-0.3.11/.github/workflows/unittest.yml +335 -0
  4. tensorneko_lib-0.3.11/.gitignore +270 -0
  5. tensorneko_lib-0.3.11/Cargo.lock +758 -0
  6. tensorneko_lib-0.3.11/Cargo.toml +19 -0
  7. tensorneko_lib-0.3.11/LICENSE +21 -0
  8. tensorneko_lib-0.3.11/PKG-INFO +669 -0
  9. tensorneko_lib-0.3.11/README.md +643 -0
  10. tensorneko_lib-0.3.11/init.py +20 -0
  11. tensorneko_lib-0.3.11/pypi.sh +16 -0
  12. tensorneko_lib-0.3.11/pyproject.toml +36 -0
  13. tensorneko_lib-0.3.11/requirements.txt +11 -0
  14. tensorneko_lib-0.3.11/requirements_test.txt +15 -0
  15. tensorneko_lib-0.3.11/requirements_util.txt +2 -0
  16. tensorneko_lib-0.3.11/src/tensorneko_lib/evaluation/loc_1d.rs +378 -0
  17. tensorneko_lib-0.3.11/src/tensorneko_lib/evaluation/mod.rs +12 -0
  18. tensorneko_lib-0.3.11/src/tensorneko_lib/lib.rs +19 -0
  19. tensorneko_lib-0.3.11/test/__init__.py +0 -0
  20. tensorneko_lib-0.3.11/test/benchmark/benchmark_eventbus.py +53 -0
  21. tensorneko_lib-0.3.11/test/callback/__init__.py +0 -0
  22. tensorneko_lib-0.3.11/test/callback/test_lr_logger.py +5 -0
  23. tensorneko_lib-0.3.11/test/dataset/__init__.py +0 -0
  24. tensorneko_lib-0.3.11/test/dataset/sampler/__init__.py +0 -0
  25. tensorneko_lib-0.3.11/test/dataset/sampler/test_sequential_iter_sampler.py +14 -0
  26. tensorneko_lib-0.3.11/test/dataset/test_list_dataset.py +63 -0
  27. tensorneko_lib-0.3.11/test/debug/__init__.py +0 -0
  28. tensorneko_lib-0.3.11/test/debug/test_parser.py +82 -0
  29. tensorneko_lib-0.3.11/test/evaluation/__init__.py +0 -0
  30. tensorneko_lib-0.3.11/test/evaluation/test_psnr.py +41 -0
  31. tensorneko_lib-0.3.11/test/evaluation/test_ssim.py +41 -0
  32. tensorneko_lib-0.3.11/test/io_/__init__.py +0 -0
  33. tensorneko_lib-0.3.11/test/io_/audio/__init__.py +0 -0
  34. tensorneko_lib-0.3.11/test/io_/audio/test_audio_reader.py +6 -0
  35. tensorneko_lib-0.3.11/test/io_/image/__init__.py +0 -0
  36. tensorneko_lib-0.3.11/test/io_/image/test_image_reader.py +5 -0
  37. tensorneko_lib-0.3.11/test/io_/json/__init__.py +0 -0
  38. tensorneko_lib-0.3.11/test/io_/json/test_json_reader.py +147 -0
  39. tensorneko_lib-0.3.11/test/io_/text/__init__.py +0 -0
  40. tensorneko_lib-0.3.11/test/io_/text/test_text_reader.py +12 -0
  41. tensorneko_lib-0.3.11/test/io_/video/__init__.py +0 -0
  42. tensorneko_lib-0.3.11/test/io_/video/test_video_reader.py +5 -0
  43. tensorneko_lib-0.3.11/test/io_/yaml/__init__.py +0 -0
  44. tensorneko_lib-0.3.11/test/io_/yaml/test_yaml_reader.py +11 -0
  45. tensorneko_lib-0.3.11/test/layer/__init__.py +0 -0
  46. tensorneko_lib-0.3.11/test/layer/test_concatenate.py +49 -0
  47. tensorneko_lib-0.3.11/test/layer/test_conv2d.py +121 -0
  48. tensorneko_lib-0.3.11/test/layer/test_linear.py +81 -0
  49. tensorneko_lib-0.3.11/test/layer/test_log.py +28 -0
  50. tensorneko_lib-0.3.11/test/layer/test_patching.py +135 -0
  51. tensorneko_lib-0.3.11/test/layer/test_reshape.py +17 -0
  52. tensorneko_lib-0.3.11/test/module/__init__.py +0 -0
  53. tensorneko_lib-0.3.11/test/module/test_dense.py +60 -0
  54. tensorneko_lib-0.3.11/test/module/test_inception.py +35 -0
  55. tensorneko_lib-0.3.11/test/module/test_mlp.py +87 -0
  56. tensorneko_lib-0.3.11/test/module/test_residual.py +75 -0
  57. tensorneko_lib-0.3.11/test/module/test_transformer.py +33 -0
  58. tensorneko_lib-0.3.11/test/preprocess/__init__.py +0 -0
  59. tensorneko_lib-0.3.11/test/preprocess/test_func.py +89 -0
  60. tensorneko_lib-0.3.11/test/resource/frames_sample/1.183.jpg +0 -0
  61. tensorneko_lib-0.3.11/test/resource/frames_sample/1.184.jpg +0 -0
  62. tensorneko_lib-0.3.11/test/resource/frames_sample/1.185.jpg +0 -0
  63. tensorneko_lib-0.3.11/test/resource/frames_sample/1.186.jpg +0 -0
  64. tensorneko_lib-0.3.11/test/resource/frames_sample/1.187.jpg +0 -0
  65. tensorneko_lib-0.3.11/test/resource/frames_sample/1.188.jpg +0 -0
  66. tensorneko_lib-0.3.11/test/resource/frames_sample/1.189.jpg +0 -0
  67. tensorneko_lib-0.3.11/test/resource/frames_sample/1.190.jpg +0 -0
  68. tensorneko_lib-0.3.11/test/resource/frames_sample/1.191.jpg +0 -0
  69. tensorneko_lib-0.3.11/test/resource/frames_sample/1.192.jpg +0 -0
  70. tensorneko_lib-0.3.11/test/resource/frames_sample/1.193.jpg +0 -0
  71. tensorneko_lib-0.3.11/test/resource/frames_sample/1.194.jpg +0 -0
  72. tensorneko_lib-0.3.11/test/resource/frames_sample/1.195.jpg +0 -0
  73. tensorneko_lib-0.3.11/test/resource/frames_sample/1.196.jpg +0 -0
  74. tensorneko_lib-0.3.11/test/resource/frames_sample/1.197.jpg +0 -0
  75. tensorneko_lib-0.3.11/test/resource/frames_sample/1.198.jpg +0 -0
  76. tensorneko_lib-0.3.11/test/resource/frames_sample/1.199.jpg +0 -0
  77. tensorneko_lib-0.3.11/test/resource/frames_sample/1.200.jpg +0 -0
  78. tensorneko_lib-0.3.11/test/resource/frames_sample/1.201.jpg +0 -0
  79. tensorneko_lib-0.3.11/test/resource/frames_sample/1.202.jpg +0 -0
  80. tensorneko_lib-0.3.11/test/resource/frames_sample/1.203.jpg +0 -0
  81. tensorneko_lib-0.3.11/test/resource/frames_sample/1.204.jpg +0 -0
  82. tensorneko_lib-0.3.11/test/resource/frames_sample/1.205.jpg +0 -0
  83. tensorneko_lib-0.3.11/test/resource/frames_sample/1.206.jpg +0 -0
  84. tensorneko_lib-0.3.11/test/resource/frames_sample/1.207.jpg +0 -0
  85. tensorneko_lib-0.3.11/test/resource/frames_sample/1.208.jpg +0 -0
  86. tensorneko_lib-0.3.11/test/resource/frames_sample/1.209.jpg +0 -0
  87. tensorneko_lib-0.3.11/test/resource/frames_sample/1.210.jpg +0 -0
  88. tensorneko_lib-0.3.11/test/resource/frames_sample/1.211.jpg +0 -0
  89. tensorneko_lib-0.3.11/test/resource/frames_sample/1.212.jpg +0 -0
  90. tensorneko_lib-0.3.11/test/resource/frames_sample/1.213.jpg +0 -0
  91. tensorneko_lib-0.3.11/test/resource/frames_sample/1.214.jpg +0 -0
  92. tensorneko_lib-0.3.11/test/resource/frames_sample/1.215.jpg +0 -0
  93. tensorneko_lib-0.3.11/test/resource/frames_sample/1.216.jpg +0 -0
  94. tensorneko_lib-0.3.11/test/resource/frames_sample/1.217.jpg +0 -0
  95. tensorneko_lib-0.3.11/test/resource/frames_sample/1.218.jpg +0 -0
  96. tensorneko_lib-0.3.11/test/resource/frames_sample/1.219.jpg +0 -0
  97. tensorneko_lib-0.3.11/test/resource/frames_sample/1.220.jpg +0 -0
  98. tensorneko_lib-0.3.11/test/resource/frames_sample/1.221.jpg +0 -0
  99. tensorneko_lib-0.3.11/test/resource/frames_sample/1.222.jpg +0 -0
  100. tensorneko_lib-0.3.11/test/resource/frames_sample/1.223.jpg +0 -0
  101. tensorneko_lib-0.3.11/test/resource/frames_sample/1.224.jpg +0 -0
  102. tensorneko_lib-0.3.11/test/resource/frames_sample/1.225.jpg +0 -0
  103. tensorneko_lib-0.3.11/test/resource/frames_sample/1.226.jpg +0 -0
  104. tensorneko_lib-0.3.11/test/resource/frames_sample/1.227.jpg +0 -0
  105. tensorneko_lib-0.3.11/test/resource/frames_sample/1.228.jpg +0 -0
  106. tensorneko_lib-0.3.11/test/resource/frames_sample/1.229.jpg +0 -0
  107. tensorneko_lib-0.3.11/test/resource/frames_sample/1.230.jpg +0 -0
  108. tensorneko_lib-0.3.11/test/resource/frames_sample/1.231.jpg +0 -0
  109. tensorneko_lib-0.3.11/test/resource/image_sample/1.183.jpg +0 -0
  110. tensorneko_lib-0.3.11/test/resource/test_read_json/test_read_json_as_dict.json +1 -0
  111. tensorneko_lib-0.3.11/test/resource/test_read_json/test_read_json_as_list.json +1 -0
  112. tensorneko_lib-0.3.11/test/resource/test_read_json/test_read_json_as_list_in_list.json +7 -0
  113. tensorneko_lib-0.3.11/test/resource/test_read_json/test_read_json_as_list_in_obj.json +6 -0
  114. tensorneko_lib-0.3.11/test/resource/test_read_json/test_read_json_as_obj_in_list_in_list.json +7 -0
  115. tensorneko_lib-0.3.11/test/resource/test_read_json/test_read_json_as_obj_in_obj.json +4 -0
  116. tensorneko_lib-0.3.11/test/resource/test_read_json/test_read_json_as_obj_in_obj_in_obj.json +14 -0
  117. tensorneko_lib-0.3.11/test/resource/test_read_text/text.txt +2 -0
  118. tensorneko_lib-0.3.11/test/resource/test_read_yaml/test_read_yaml_as_dict.yaml +3 -0
  119. tensorneko_lib-0.3.11/test/resource/video_sample/sample.mp4 +0 -0
  120. tensorneko_lib-0.3.11/test/simulate/simulate_train_mnist_cla.py +120 -0
  121. tensorneko_lib-0.3.11/test/simulate/simulate_train_mnist_gan.py +101 -0
  122. tensorneko_lib-0.3.11/test/test_library_info.py +17 -0
  123. tensorneko_lib-0.3.11/test/test_version.py +55 -0
  124. tensorneko_lib-0.3.11/test/util/__init__.py +0 -0
  125. tensorneko_lib-0.3.11/test/util/eventbus/__init__.py +0 -0
  126. tensorneko_lib-0.3.11/test/util/eventbus/test_event_bus.py +201 -0
  127. tensorneko_lib-0.3.11/test/util/eventbus/test_handler_class.py +75 -0
  128. tensorneko_lib-0.3.11/test/util/fp/__init__.py +0 -0
  129. tensorneko_lib-0.3.11/test/util/fp/test_args.py +23 -0
  130. tensorneko_lib-0.3.11/test/util/fp/test_func.py +96 -0
  131. tensorneko_lib-0.3.11/test/util/fp/test_seq.py +106 -0
  132. tensorneko_lib-0.3.11/test/util/fp/test_stream.py +154 -0
  133. tensorneko_lib-0.3.11/test/util/fp/test_underscore.py +299 -0
  134. tensorneko_lib-0.3.11/test/util/test_average_meter.py +20 -0
  135. tensorneko_lib-0.3.11/test/util/test_bimap.py +101 -0
  136. tensorneko_lib-0.3.11/test/util/test_dispatcher.py +70 -0
  137. tensorneko_lib-0.3.11/test/util/test_func.py +241 -0
  138. tensorneko_lib-0.3.11/test/util/test_reproducibility.py +24 -0
  139. tensorneko_lib-0.3.11/test/util/test_singleton.py +50 -0
  140. tensorneko_lib-0.3.11/test/util/test_string_getter.py +80 -0
  141. tensorneko_lib-0.3.11/test/visualization/__init__.py +0 -0
  142. tensorneko_lib-0.3.11/test/visualization/test_matplotlib.py +24 -0
  143. tensorneko_lib-0.3.11/version.txt +1 -0
@@ -0,0 +1,149 @@
1
+ name: Release lib
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ workflow_call:
7
+ secrets:
8
+ PYPI_API_TOKEN:
9
+ required: true
10
+
11
+ jobs:
12
+
13
+ source:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Modify the setup files
18
+ run: |
19
+ rm -rf src/tensorneko_util
20
+ rm -rf src/tensorneko
21
+ rm -rf test
22
+ rm -rf .github
23
+ rm requirements.txt requirements_util.txt requirements_test.txt pypi.sh init.py .gitignore
24
+ rm setup.py
25
+ rm setup_util.py
26
+ mv pyproject_lib.toml pyproject.toml
27
+ new_version=$(cat version.txt) && sed -i "/^\[package\]$/,/^\[/ s/^version = \".*\"/version = \"$new_version\"/" Cargo.toml
28
+ rm version.txt
29
+ - uses: PyO3/maturin-action@v1
30
+ with:
31
+ command: sdist
32
+ args: -o dist
33
+ rust-toolchain: nightly
34
+ - name: Upload dist
35
+ uses: actions/upload-artifact@v2
36
+ with:
37
+ name: tensorneko-lib
38
+ path: dist
39
+
40
+ linux:
41
+ runs-on: ubuntu-latest
42
+ strategy:
43
+ matrix:
44
+ target: [x86_64, aarch64, armv7, s390x, ppc64le]
45
+ fail-fast: false
46
+
47
+ steps:
48
+ - uses: actions/checkout@v4
49
+ - name: Modify the setup files
50
+ run: |
51
+ rm -rf src/tensorneko_util
52
+ rm -rf src/tensorneko
53
+ rm setup.py
54
+ rm setup_util.py
55
+ mv pyproject_lib.toml pyproject.toml
56
+ new_version=$(cat version.txt) && sed -i "/^\[package\]$/,/^\[/ s/^version = \".*\"/version = \"$new_version\"/" Cargo.toml
57
+ - uses: PyO3/maturin-action@v1
58
+ with:
59
+ manylinux: auto
60
+ command: build
61
+ rust-toolchain: nightly
62
+ target: ${{ matrix.target }}
63
+ args: --release -o dist -i 3.7 3.8 3.9 3.10 3.11 pypy3.8 pypy3.9
64
+ - name: Upload wheels
65
+ uses: actions/upload-artifact@v2
66
+ with:
67
+ name: tensorneko-lib
68
+ path: dist
69
+
70
+ windows:
71
+ runs-on: windows-latest
72
+ steps:
73
+ - uses: actions/checkout@v4
74
+ - name: Modify the setup files
75
+ run: |
76
+ Remove-Item src/tensorneko_util -Recurse -Force
77
+ Remove-Item src/tensorneko -Recurse -Force
78
+ Remove-Item setup.py -Force
79
+ Remove-Item setup_util.py -Force
80
+ Move-Item pyproject_lib.toml pyproject.toml
81
+ $new_version = Get-Content version.txt -Raw
82
+ $in_package_section = $false
83
+ (Get-Content Cargo.toml -Raw) -split "`r`n" | ForEach-Object {
84
+ if ($_ -match '^\[package\]$') {
85
+ $in_package_section = $true
86
+ }
87
+ if ($_ -match '^\[.*\]$' -and $_ -notmatch '^\[package\]$') {
88
+ $in_package_section = $false
89
+ }
90
+ if ($in_package_section -and $_ -match '^version = "') {
91
+ $_ -replace 'version = "[0-9]*\.[0-9]*\.[0-9]*"', "version = `"$new_version`""
92
+ } else {
93
+ $_
94
+ }
95
+ } | Set-Content Cargo.toml
96
+ shell: powershell
97
+
98
+ - uses: PyO3/maturin-action@v1
99
+ with:
100
+ command: build
101
+ target: x64
102
+ args: --release -o dist -i 3.7 3.8 3.9 3.10 3.11
103
+ rust-toolchain: nightly
104
+ - name: Upload wheels
105
+ uses: actions/upload-artifact@v2
106
+ with:
107
+ name: tensorneko-lib
108
+ path: dist
109
+
110
+ macos:
111
+ runs-on: macos-latest
112
+ steps:
113
+ - uses: actions/checkout@v4
114
+ - name: Modify the setup files
115
+ run: |
116
+ rm -rf src/tensorneko_util
117
+ rm -rf src/tensorneko
118
+ rm setup.py
119
+ rm setup_util.py
120
+ mv pyproject_lib.toml pyproject.toml
121
+ new_version=$(cat version.txt) && sed -i '' "/^\[package\]$/,/^\[/ s/^version = \".*\"/version = \"$new_version\"/" Cargo.toml
122
+ - uses: PyO3/maturin-action@v1
123
+ with:
124
+ command: build
125
+ args: --release -o dist --sdist -i 3.7 3.8 3.9 3.10 3.11 pypy3.8 pypy3.9
126
+ target: universal2-apple-darwin
127
+ rust-toolchain: nightly
128
+ - name: Upload wheels
129
+ uses: actions/upload-artifact@v2
130
+ with:
131
+ name: tensorneko-lib
132
+ path: dist
133
+
134
+ # release:
135
+ # name: Release
136
+ # runs-on: ubuntu-latest
137
+ # needs: [ macos, windows, linux, source ]
138
+ # steps:
139
+ # - uses: actions/download-artifact@v2
140
+ # with:
141
+ # name: tensorneko-lib
142
+ # path: wheels
143
+ # - name: Publish to PyPI
144
+ # uses: messense/maturin-action@v1
145
+ # env:
146
+ # MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
147
+ # with:
148
+ # command: upload
149
+ # args: --skip-existing *
@@ -0,0 +1,266 @@
1
+ name: Release
2
+ on:
3
+ push:
4
+ branches:
5
+ - "master"
6
+ jobs:
7
+ check-version:
8
+ name: Check Version
9
+ runs-on: ubuntu-20.04
10
+ outputs:
11
+ local-version: ${{ steps.get-local-version.outputs.version }}
12
+ remote-version-tensorneko: ${{ steps.get-remote-version-tensorneko.outputs.tensorneko-version }}
13
+ remote-version-tensorneko-util: ${{ steps.get-remote-version-tensorneko-util.outputs.tensorneko-util-version }}
14
+ remote-version-tensorneko-lib: ${{ steps.get-remote-version-tensorneko-lib.outputs.tensorneko-lib-version }}
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - name: Get Local Version
18
+ id: get-local-version
19
+ run: echo "version=$(cat version.txt)" >> $GITHUB_OUTPUT
20
+ - name: Get Remote Version Tensorneko
21
+ id: get-remote-version-tensorneko
22
+ run: echo "version=$(curl -s https://pypi.org/pypi/tensorneko/json | jq -r '.info.version')" >> $GITHUB_OUTPUT
23
+ - name: Get Remote Version Tensorneko Util
24
+ id: get-remote-version-tensorneko-util
25
+ run: echo "version=$(curl -s https://pypi.org/pypi/tensorneko_util/json | jq -r '.info.version')" >> $GITHUB_OUTPUT
26
+ - name: Get Remote Version Tensorneko Lib
27
+ id: get-remote-version-tensorneko-lib
28
+ run: echo "version=$(curl -s https://pypi.org/pypi/tensorneko_lib/json | jq -r '.info.version')" >> $GITHUB_OUTPUT
29
+
30
+ build-web:
31
+ name: Build Web
32
+ runs-on: ubuntu-20.04
33
+
34
+ steps:
35
+ - uses: actions/checkout@v2
36
+
37
+ - name: Use Node.js 16.x
38
+ uses: actions/setup-node@v1
39
+ with:
40
+ node-version: 16.x
41
+
42
+ - name: npm install and build
43
+ working-directory: ./src/tensorneko_util/visualization/watcher/web
44
+ run: |
45
+ npm install
46
+ npm run build
47
+ env:
48
+ CI: true
49
+
50
+ - name: Print dist path
51
+ working-directory: ./src/tensorneko_util/visualization/watcher/web
52
+ run: |
53
+ echo ----------dist-------
54
+ ls -l dist
55
+ echo ----------dist/assets-------
56
+ ls -l dist/assets
57
+
58
+ unittest:
59
+ name: Unittest
60
+ runs-on: ubuntu-20.04
61
+
62
+ strategy:
63
+ fail-fast: false
64
+ matrix:
65
+ python-version: ["3.8", "3.9", "3.10", "3.11"]
66
+ torch-version: ["1.9.*", "1.10.*", "1.11.*", "1.12.*", "1.13.*", "2.0.*", "2.1.*", "2.2.*"]
67
+ lightning-version: ["2.0.*", "2.1.*", "2.2.*"]
68
+ exclude:
69
+ - python-version: "3.10"
70
+ torch-version: "1.8.*"
71
+ - python-version: "3.10"
72
+ torch-version: "1.9.*"
73
+ - python-version: "3.10"
74
+ torch-version: "1.10.*"
75
+
76
+ - python-version: "3.11"
77
+ torch-version: "1.8.*"
78
+ - python-version: "3.11"
79
+ torch-version: "1.9.*"
80
+ - python-version: "3.11"
81
+ torch-version: "1.10.*"
82
+ - python-version: "3.11"
83
+ torch-version: "1.11.*"
84
+ - python-version: "3.11"
85
+ torch-version: "1.12.*"
86
+
87
+ steps:
88
+ - uses: actions/checkout@v2
89
+
90
+ - name: Set up Python
91
+ uses: actions/setup-python@v2
92
+ with:
93
+ python-version: ${{ matrix.python-version }}
94
+ architecture: x64
95
+
96
+ - name: Install dependencies
97
+ run: |
98
+ pip install torch==${{ matrix.torch-version }}
99
+ pip install lightning==${{ matrix.lightning-version }}
100
+ pip install -r requirements_test.txt
101
+ python init.py
102
+
103
+ - name: Set PYTHONPATH
104
+ run: echo "PYTHONPATH=$(pwd)/src" >> $GITHUB_ENV
105
+
106
+ - name: Run Test
107
+ run: python -m unittest discover test
108
+
109
+ release-tensorneko:
110
+ name: Release Tensorneko
111
+ needs: [build-web, unittest, check-version]
112
+ if: needs.check-version.outputs.local-version != needs.check-version.outputs.remote-version-tensorneko
113
+ runs-on: ubuntu-20.04
114
+
115
+ strategy:
116
+ matrix:
117
+ python-version: [3.9]
118
+
119
+ steps:
120
+ - uses: actions/checkout@v2
121
+
122
+ - name: Set up Python
123
+ uses: actions/setup-python@v2
124
+ with:
125
+ python-version: ${{ matrix.python-version }}
126
+ architecture: x64
127
+
128
+ - name: Install dependencies
129
+ run: |
130
+ pip install -r requirements.txt
131
+ pip install wheel
132
+ python init.py
133
+
134
+ - name: Build package for tensorneko
135
+ run: python setup.py sdist bdist_wheel
136
+
137
+ - name: Release tensorneko to PyPI
138
+ uses: pypa/gh-action-pypi-publish@release/v1
139
+ with:
140
+ user: __token__
141
+ password: ${{ secrets.PYPI_API_TOKEN }}
142
+
143
+ - name: Save to artifact
144
+ uses: actions/upload-artifact@v2
145
+ with:
146
+ name: tensorneko
147
+ path: dist/
148
+
149
+ release-tensorneko-util:
150
+ name: Release Tensorneko Util
151
+ needs: [build-web, unittest, check-version]
152
+ if: needs.check-version.outputs.local-version != needs.check-version.outputs.remote-version-tensorneko-util
153
+ runs-on: ubuntu-20.04
154
+
155
+ strategy:
156
+ matrix:
157
+ python-version: [3.9]
158
+
159
+ steps:
160
+ - uses: actions/checkout@v2
161
+
162
+ - name: Use Node.js 16.x
163
+ uses: actions/setup-node@v1
164
+ with:
165
+ node-version: 16.x
166
+
167
+ - name: npm install and build
168
+ working-directory: ./src/tensorneko_util/visualization/watcher/web
169
+ run: |
170
+ npm install
171
+ npm run build
172
+ env:
173
+ CI: true
174
+
175
+ - name: Set up Python
176
+ uses: actions/setup-python@v2
177
+ with:
178
+ python-version: ${{ matrix.python-version }}
179
+ architecture: x64
180
+
181
+ - name: Install dependencies
182
+ run: |
183
+ pip install -r requirements.txt
184
+ pip install wheel
185
+ python init.py
186
+
187
+ - name: Build package for tensorneko_util
188
+ run: python setup_util.py sdist bdist_wheel
189
+
190
+ - name: Release tensorneko_util to PyPI
191
+ uses: pypa/gh-action-pypi-publish@release/v1
192
+ with:
193
+ user: __token__
194
+ password: ${{ secrets.PYPI_UTIL_API_TOKEN }}
195
+
196
+ - name: Save to artifact
197
+ uses: actions/upload-artifact@v2
198
+ with:
199
+ name: tensorneko-util
200
+ path: dist/
201
+
202
+ release-tensorneko-lib:
203
+ name: Release Tensorneko Lib
204
+ needs: [check-version]
205
+ if: needs.check-version.outputs.local-version != needs.check-version.outputs.remote-version-tensorneko-lib
206
+ uses: ./.github/workflows/release-lib.yml
207
+ secrets:
208
+ PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
209
+
210
+ github-release:
211
+ name: Release
212
+ needs: [release-tensorneko, release-tensorneko-util, release-tensorneko-lib]
213
+ runs-on: ubuntu-20.04
214
+
215
+ strategy:
216
+ matrix:
217
+ python-version: [3.9]
218
+
219
+ steps:
220
+ - uses: actions/checkout@v2
221
+
222
+ - name: Set up Python
223
+ uses: actions/setup-python@v2
224
+ with:
225
+ python-version: ${{ matrix.python-version }}
226
+ architecture: x64
227
+
228
+ - name: Get the version
229
+ run: |
230
+ VER=$(cat version.txt)
231
+ echo "VERSION=$VER" >> $GITHUB_ENV
232
+
233
+ - name: Download artifacts
234
+ uses: actions/download-artifact@v2
235
+ with:
236
+ name: tensorneko
237
+ path: dist_tensorneko/
238
+
239
+ - name: Download artifacts
240
+ uses: actions/download-artifact@v2
241
+ with:
242
+ name: tensorneko-util
243
+ path: dist_tensorneko_util/
244
+
245
+ - name: Download artifacts
246
+ uses: actions/download-artifact@v2
247
+ with:
248
+ name: tensorneko-lib
249
+ path: dist_tensorneko_lib/
250
+
251
+ - name: Merge the artifacts
252
+ run: |
253
+ mkdir dist
254
+ cp -r dist_tensorneko/* dist/
255
+ cp -r dist_tensorneko_util/* dist/
256
+ cp -r dist_tensorneko_lib/* dist/
257
+
258
+ - name: Release to GitHub Release
259
+ uses: marvinpinto/action-automatic-releases@latest
260
+ with:
261
+ repo_token: "${{ secrets.GITHUB_TOKEN }}"
262
+ automatic_release_tag: "${{ env.VERSION }}"
263
+ title: "[${{ env.VERSION }}] TensorNeko Release"
264
+ prerelease: false
265
+ files: "dist/*"
266
+ draft: true