split-python4gpt 1.0.2__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 (28) hide show
  1. split_python4gpt-1.0.2/.coveragerc +28 -0
  2. split_python4gpt-1.0.2/.github/workflows/ci.yml +80 -0
  3. split_python4gpt-1.0.2/.gitignore +54 -0
  4. split_python4gpt-1.0.2/.isort.cfg +3 -0
  5. split_python4gpt-1.0.2/.pre-commit-config.yaml +67 -0
  6. split_python4gpt-1.0.2/AUTHORS.md +3 -0
  7. split_python4gpt-1.0.2/LICENSE.txt +201 -0
  8. split_python4gpt-1.0.2/PKG-INFO +74 -0
  9. split_python4gpt-1.0.2/README.md +48 -0
  10. split_python4gpt-1.0.2/pydoc-markdown.yml +6 -0
  11. split_python4gpt-1.0.2/pyproject.toml +9 -0
  12. split_python4gpt-1.0.2/setup.cfg +89 -0
  13. split_python4gpt-1.0.2/setup.py +21 -0
  14. split_python4gpt-1.0.2/src/split_python4gpt/__init__.py +17 -0
  15. split_python4gpt-1.0.2/src/split_python4gpt/__main__.py +56 -0
  16. split_python4gpt-1.0.2/src/split_python4gpt/minifier.py +146 -0
  17. split_python4gpt-1.0.2/src/split_python4gpt.egg-info/PKG-INFO +74 -0
  18. split_python4gpt-1.0.2/src/split_python4gpt.egg-info/SOURCES.txt +27 -0
  19. split_python4gpt-1.0.2/src/split_python4gpt.egg-info/dependency_links.txt +1 -0
  20. split_python4gpt-1.0.2/src/split_python4gpt.egg-info/entry_points.txt +2 -0
  21. split_python4gpt-1.0.2/src/split_python4gpt.egg-info/not-zip-safe +1 -0
  22. split_python4gpt-1.0.2/src/split_python4gpt.egg-info/requires.txt +9 -0
  23. split_python4gpt-1.0.2/src/split_python4gpt.egg-info/top_level.txt +1 -0
  24. split_python4gpt-1.0.2/tests/conftest.py +10 -0
  25. split_python4gpt-1.0.2/tests/data/in_test.py +2 -0
  26. split_python4gpt-1.0.2/tests/data/out_test.py +1 -0
  27. split_python4gpt-1.0.2/tests/test_minifier.py +18 -0
  28. split_python4gpt-1.0.2/tox.ini +93 -0
@@ -0,0 +1,28 @@
1
+ # .coveragerc to control coverage.py
2
+ [run]
3
+ branch = True
4
+ source = split_python4gpt
5
+ # omit = bad_file.py
6
+
7
+ [paths]
8
+ source =
9
+ src/
10
+ */site-packages/
11
+
12
+ [report]
13
+ # Regexes for lines to exclude from consideration
14
+ exclude_lines =
15
+ # Have to re-enable the standard pragma
16
+ pragma: no cover
17
+
18
+ # Don't complain about missing debug-only code:
19
+ def __repr__
20
+ if self\.debug
21
+
22
+ # Don't complain if tests don't hit defensive assertion code:
23
+ raise AssertionError
24
+ raise NotImplementedError
25
+
26
+ # Don't complain if non-runnable code isn't run:
27
+ if 0:
28
+ if __name__ == .__main__.:
@@ -0,0 +1,80 @@
1
+ name: Test, Build, and Publish
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ['v[0-9]*', '[0-9]+.[0-9]+*']
7
+ pull_request:
8
+ workflow_dispatch:
9
+ schedule:
10
+ - cron: '0 0 1,16 * *'
11
+
12
+ permissions:
13
+ contents: write
14
+
15
+ concurrency:
16
+ group: >-
17
+ ${{ github.workflow }}-${{ github.ref_type }}- ${{ github.event.pull_request.number || github.sha }}
18
+
19
+
20
+ cancel-in-progress: true
21
+
22
+ jobs:
23
+ test:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v2
27
+ - name: Set up Python
28
+ uses: actions/setup-python@v2
29
+ with:
30
+ python-version: '3.10'
31
+ - name: Install dependencies
32
+ run: |
33
+ python -m pip install --upgrade pip
34
+ pip install pytest
35
+ pip install -e .
36
+ - name: Run tests
37
+ run: pytest
38
+
39
+ update-docs:
40
+ needs: test
41
+ runs-on: ubuntu-latest
42
+ steps:
43
+ - uses: actions/checkout@v2
44
+ with:
45
+ ref: ${{ github.head_ref }}
46
+ - name: Set up Python
47
+ uses: actions/setup-python@v2
48
+ with:
49
+ python-version: '3.10'
50
+ - name: Install pydoc-markdown
51
+ run: pip install pydoc-markdown
52
+ - name: Generate API documentation
53
+ run: pydoc-markdown > API.md
54
+ - name: Commit and push if it's changed
55
+ uses: EndBug/add-and-commit@v9
56
+ with:
57
+ message: 'Update API documentation'
58
+ add: 'API.md'
59
+
60
+ build-and-publish:
61
+ needs: test
62
+ runs-on: ubuntu-latest
63
+ if: startsWith(github.ref, 'refs/tags/')
64
+ steps:
65
+ - uses: actions/checkout@v2
66
+ - name: Set up Python
67
+ uses: actions/setup-python@v2
68
+ with:
69
+ python-version: '3.10'
70
+ - name: Install dependencies
71
+ run: |
72
+ python -m pip install --upgrade pip
73
+ pip install build
74
+ - name: Build distribution
75
+ run: python -m build
76
+ - name: Publish to PyPi
77
+ uses: pypa/gh-action-pypi-publish@release/v1
78
+ with:
79
+ user: __token__
80
+ password: ${{ secrets.PYPI_TOKEN }}
@@ -0,0 +1,54 @@
1
+ # Temporary and binary files
2
+ *~
3
+ *.py[cod]
4
+ *.so
5
+ *.cfg
6
+ !.isort.cfg
7
+ !setup.cfg
8
+ *.orig
9
+ *.log
10
+ *.pot
11
+ __pycache__/*
12
+ .cache/*
13
+ .*.swp
14
+ */.ipynb_checkpoints/*
15
+ .DS_Store
16
+
17
+ # Project files
18
+ .ropeproject
19
+ .project
20
+ .pydevproject
21
+ .settings
22
+ .idea
23
+ .vscode
24
+ tags
25
+
26
+ # Package files
27
+ *.egg
28
+ *.eggs/
29
+ .installed.cfg
30
+ *.egg-info
31
+
32
+ # Unittest and coverage
33
+ htmlcov/*
34
+ .coverage
35
+ .coverage.*
36
+ .tox
37
+ junit*.xml
38
+ coverage.xml
39
+ .pytest_cache/
40
+
41
+ # Build and docs folder/files
42
+ build/*
43
+ dist/*
44
+ sdist/*
45
+ docs/api/*
46
+ docs/_rst/*
47
+ docs/_build/*
48
+ cover/*
49
+ MANIFEST
50
+
51
+ # Per-project virtualenvs
52
+ .venv*/
53
+ .conda*/
54
+ .python-version
@@ -0,0 +1,3 @@
1
+ [settings]
2
+ profile = black
3
+ known_first_party = split_python4gpt
@@ -0,0 +1,67 @@
1
+ exclude: '^docs/conf.py'
2
+
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v4.4.0
6
+ hooks:
7
+ - id: trailing-whitespace
8
+ - id: check-added-large-files
9
+ - id: check-ast
10
+ - id: check-json
11
+ - id: check-merge-conflict
12
+ - id: check-xml
13
+ - id: check-yaml
14
+ - id: debug-statements
15
+ - id: end-of-file-fixer
16
+ - id: requirements-txt-fixer
17
+ - id: mixed-line-ending
18
+ args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows
19
+
20
+ ## If you want to automatically "modernize" your Python code:
21
+ # - repo: https://github.com/asottile/pyupgrade
22
+ # rev: v3.3.1
23
+ # hooks:
24
+ # - id: pyupgrade
25
+ # args: ['--py37-plus']
26
+
27
+ ## If you want to avoid flake8 errors due to unused vars or imports:
28
+ # - repo: https://github.com/PyCQA/autoflake
29
+ # rev: v2.0.2
30
+ # hooks:
31
+ # - id: autoflake
32
+ # args: [
33
+ # --in-place,
34
+ # --remove-all-unused-imports,
35
+ # --remove-unused-variables,
36
+ # ]
37
+
38
+ - repo: https://github.com/PyCQA/isort
39
+ rev: 5.11.5
40
+ hooks:
41
+ - id: isort
42
+
43
+ - repo: https://github.com/psf/black
44
+ rev: stable
45
+ hooks:
46
+ - id: black
47
+ language_version: python3
48
+
49
+ ## If like to embrace black styles even in the docs:
50
+ # - repo: https://github.com/asottile/blacken-docs
51
+ # rev: v1.13.0
52
+ # hooks:
53
+ # - id: blacken-docs
54
+ # additional_dependencies: [black]
55
+
56
+ - repo: https://github.com/PyCQA/flake8
57
+ rev: 5.0.4
58
+ hooks:
59
+ - id: flake8
60
+ ## You can add flake8 plugins via `additional_dependencies`:
61
+ # additional_dependencies: [flake8-bugbear]
62
+
63
+ ## Check for misspells in documentation files:
64
+ # - repo: https://github.com/codespell-project/codespell
65
+ # rev: v2.2.4
66
+ # hooks:
67
+ # - id: codespell
@@ -0,0 +1,3 @@
1
+ # Contributors
2
+
3
+ - Adam Twardoch <adam+github@twardoch.com>
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright {yyyy} {name of copyright owner}
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,74 @@
1
+ Metadata-Version: 2.1
2
+ Name: split_python4gpt
3
+ Version: 1.0.2
4
+ Summary: Python tool designed to reorganize large Python projects into minified files based on a specified token limit. This is particularly useful for processing large Python projects with GPT models, as it allows the models to handle the data in manageable chunks.
5
+ Home-page: https://github.com/twardoch/split-python4gpt
6
+ Author: Adam Twardoch
7
+ Author-email: adam+github@twardoch.com
8
+ License: Apache-2.0
9
+ Project-URL: Documentation, https://twardoch.github.io/split-python4gpt/
10
+ Project-URL: Source, https://github.com/twardoch/split-python4gpt
11
+ Keywords: python,code-summarization,openai,text-summarization,summarization,code-processing,gpt,data-preprocessing,openai-gpt,gpt-3,gpt-4,gpt-35-turbo,gpt-35-turbo-16k
12
+ Platform: any
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Programming Language :: Python
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Intended Audience :: Science/Research
19
+ Classifier: Topic :: Text Processing
20
+ Classifier: License :: OSI Approved :: Apache Software License
21
+ Classifier: Operating System :: OS Independent
22
+ Requires-Python: <3.11,>=3.10
23
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
24
+ Provides-Extra: testing
25
+ License-File: LICENSE.txt
26
+
27
+ # split_python4gpt
28
+
29
+ `split_python4gpt` is a Python tool designed to reorganize large Python projects into minified files based on a specified token limit. This is particularly useful for processing large Python projects with GPT models, as it allows the models to handle the data in manageable chunks.
30
+
31
+ _**Version 1.0.2** (2023-06-22)_
32
+
33
+ ### NOT IMPLEMENTED YET
34
+
35
+ Warning: The code does not yet implement the splitting or token counting, only type inference and minification. Use at your own risk.
36
+
37
+ ## Installation
38
+
39
+ You can install `split_python4gpt` via pip:
40
+
41
+ ```bash
42
+ pip install split_python4gpt
43
+ ```
44
+
45
+ ## CLI Usage
46
+
47
+ ### This is not yet implemented!
48
+
49
+ After installation, you can use the `pysplit4gpt` or `python3.10 -m split_python4gpt` command to split a Python file. Here's the basic syntax:
50
+
51
+ ```bash
52
+ python3.10 -m split_python4gpt py_path_or_folder --model gpt-3.5-turbo --limit 4096 --separator "=== SPLIT ==="
53
+ ```
54
+
55
+ This command will split the Python file or all Python files in `py_path_or_folder` into sections, each containing no more than 4096 tokens (as counted by the `gpt-3.5-turbo` model). The sections will be separated by `=== SPLIT ===`.
56
+
57
+ ## Python usage
58
+
59
+ - **[See the API documentation](https://twardoch.github.io/split-python4gpt/API.html)** for more advanced usage
60
+
61
+ ## Changelog
62
+
63
+ - v1.0.0: Initial release
64
+
65
+ ## Contributing
66
+
67
+ Contributions to `split_python4gpt` are welcome! Please open an issue or submit a pull request on the [GitHub repository](https://github.com/twardoch/split-python4gpt).
68
+
69
+ ## License
70
+
71
+ - Copyright (c) 2023 [Adam Twardoch](./AUTHORS.md)
72
+ - Written with assistance from ChatGPT
73
+ - Licensed under the [Apache License 2.0](./LICENSE.txt)<a id="split_python4gpt"></a>
74
+
@@ -0,0 +1,48 @@
1
+ # split_python4gpt
2
+
3
+ `split_python4gpt` is a Python tool designed to reorganize large Python projects into minified files based on a specified token limit. This is particularly useful for processing large Python projects with GPT models, as it allows the models to handle the data in manageable chunks.
4
+
5
+ _**Version 1.0.2** (2023-06-22)_
6
+
7
+ ### NOT IMPLEMENTED YET
8
+
9
+ Warning: The code does not yet implement the splitting or token counting, only type inference and minification. Use at your own risk.
10
+
11
+ ## Installation
12
+
13
+ You can install `split_python4gpt` via pip:
14
+
15
+ ```bash
16
+ pip install split_python4gpt
17
+ ```
18
+
19
+ ## CLI Usage
20
+
21
+ ### This is not yet implemented!
22
+
23
+ After installation, you can use the `pysplit4gpt` or `python3.10 -m split_python4gpt` command to split a Python file. Here's the basic syntax:
24
+
25
+ ```bash
26
+ python3.10 -m split_python4gpt py_path_or_folder --model gpt-3.5-turbo --limit 4096 --separator "=== SPLIT ==="
27
+ ```
28
+
29
+ This command will split the Python file or all Python files in `py_path_or_folder` into sections, each containing no more than 4096 tokens (as counted by the `gpt-3.5-turbo` model). The sections will be separated by `=== SPLIT ===`.
30
+
31
+ ## Python usage
32
+
33
+ - **[See the API documentation](https://twardoch.github.io/split-python4gpt/API.html)** for more advanced usage
34
+
35
+ ## Changelog
36
+
37
+ - v1.0.0: Initial release
38
+
39
+ ## Contributing
40
+
41
+ Contributions to `split_python4gpt` are welcome! Please open an issue or submit a pull request on the [GitHub repository](https://github.com/twardoch/split-python4gpt).
42
+
43
+ ## License
44
+
45
+ - Copyright (c) 2023 [Adam Twardoch](./AUTHORS.md)
46
+ - Written with assistance from ChatGPT
47
+ - Licensed under the [Apache License 2.0](./LICENSE.txt)<a id="split_python4gpt"></a>
48
+
@@ -0,0 +1,6 @@
1
+ loaders:
2
+ - type: python
3
+ processors:
4
+ - type: filter
5
+ renderer:
6
+ type: markdown
@@ -0,0 +1,9 @@
1
+ [build-system]
2
+ # AVOID CHANGING REQUIRES: IT WILL BE UPDATED BY PYSCAFFOLD!
3
+ requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5"]
4
+ build-backend = "setuptools.build_meta"
5
+
6
+ [tool.setuptools_scm]
7
+ # For smarter version schemes and other configuration options,
8
+ # check out https://github.com/pypa/setuptools_scm
9
+ version_scheme = "no-guess-dev"
@@ -0,0 +1,89 @@
1
+ [metadata]
2
+ name = split_python4gpt
3
+ description = Python tool designed to reorganize large Python projects into minified files based on a specified token limit. This is particularly useful for processing large Python projects with GPT models, as it allows the models to handle the data in manageable chunks.
4
+ author = Adam Twardoch
5
+ author_email = adam+github@twardoch.com
6
+ license = Apache-2.0
7
+ license_files = LICENSE.txt
8
+ long_description = file: README.md
9
+ long_description_content_type = text/markdown; charset=UTF-8; variant=GFM
10
+ url = https://github.com/twardoch/split-python4gpt
11
+ project_urls =
12
+ Documentation = https://twardoch.github.io/split-python4gpt/
13
+ Source = https://github.com/twardoch/split-python4gpt
14
+ platforms = any
15
+ classifiers =
16
+ Development Status :: 4 - Beta
17
+ Programming Language :: Python
18
+ Programming Language :: Python :: 3
19
+ Programming Language :: Python :: 3.10
20
+ Intended Audience :: Developers
21
+ Intended Audience :: Science/Research
22
+ Topic :: Text Processing
23
+ License :: OSI Approved :: Apache Software License
24
+ Operating System :: OS Independent
25
+ keywords = python, code-summarization, openai, text-summarization, summarization, code-processing, gpt, data-preprocessing, openai-gpt, gpt-3, gpt-4, gpt-35-turbo, gpt-35-turbo-16k
26
+
27
+ [options]
28
+ zip_safe = False
29
+ packages = find_namespace:
30
+ include_package_data = True
31
+ package_dir =
32
+ =src
33
+ python_requires = >=3.10, <3.11
34
+ install_requires =
35
+ fire>=0.5.0
36
+ tiktoken>=0.4.0
37
+ python-minifier>=2.9.0
38
+ pytype>=2023.6.16
39
+
40
+ [options.packages.find]
41
+ where = src
42
+ exclude =
43
+ tests
44
+
45
+ [options.extras_require]
46
+ testing =
47
+ setuptools
48
+ pytest
49
+ pytest-cov
50
+
51
+ [options.entry_points]
52
+ console_scripts =
53
+ mdsplit4gpt = split_python4gpt.__main__:cli
54
+
55
+ [tool:pytest]
56
+ addopts =
57
+ --verbose
58
+ norecursedirs =
59
+ dist
60
+ build
61
+ .tox
62
+ testpaths = tests
63
+
64
+ [devpi:upload]
65
+ no_vcs = 1
66
+ formats = bdist_wheel
67
+
68
+ [flake8]
69
+ max_line_length = 88
70
+ extend_ignore = E203, W503
71
+ exclude =
72
+ .tox
73
+ build
74
+ dist
75
+ .eggs
76
+ docs/conf.py
77
+
78
+ [pyscaffold]
79
+ version = 4.4.1
80
+ package = split_python4gpt
81
+ extensions =
82
+ github_actions
83
+ markdown
84
+ pre_commit
85
+
86
+ [egg_info]
87
+ tag_build =
88
+ tag_date = 0
89
+
@@ -0,0 +1,21 @@
1
+ """
2
+ Setup file for split_python4gpt.
3
+ Use setup.cfg to configure your project.
4
+
5
+ This file was generated with PyScaffold 4.4.1.
6
+ PyScaffold helps you to put up the scaffold of your new Python project.
7
+ Learn more under: https://pyscaffold.org/
8
+ """
9
+ from setuptools import setup
10
+
11
+ if __name__ == "__main__":
12
+ try:
13
+ setup(use_scm_version={"version_scheme": "no-guess-dev"})
14
+ except: # noqa
15
+ print(
16
+ "\n\nAn error occurred while building the project, "
17
+ "please ensure you have the most updated version of setuptools, "
18
+ "setuptools_scm and wheel with:\n"
19
+ " pip install -U setuptools setuptools_scm wheel\n\n"
20
+ )
21
+ raise
@@ -0,0 +1,17 @@
1
+ import sys
2
+ from .minifier import PyTypingMinifier
3
+
4
+ if sys.version_info[:2] >= (3, 8):
5
+ # TODO: Import directly (no need for conditional) when `python_requires = >= 3.8`
6
+ from importlib.metadata import PackageNotFoundError, version # pragma: no cover
7
+ else:
8
+ from importlib_metadata import PackageNotFoundError, version # pragma: no cover
9
+
10
+ try:
11
+ # Change here if project is renamed and does not equal the package name
12
+ dist_name = __name__
13
+ __version__ = version(dist_name)
14
+ except PackageNotFoundError: # pragma: no cover
15
+ __version__ = "unknown"
16
+ finally:
17
+ del version, PackageNotFoundError
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env python3
2
+ from pathlib import Path
3
+
4
+ import fire
5
+ from .minifier import PyTypingMinifier
6
+
7
+
8
+ def split_python4gpt(
9
+ path_or_folder: str | Path,
10
+ out: str | Path | None = None,
11
+ pyis: str | Path | None = None,
12
+ types: bool = True,
13
+ mini: bool = True,
14
+ mini_docs: bool = True,
15
+ mini_globs: bool = False,
16
+ mini_locs: bool = False,
17
+ mini_lits: bool = True,
18
+ mini_annotations: bool = True,
19
+ mini_asserts: bool = True,
20
+ mini_debug: bool = True,
21
+ mini_imports: bool = True,
22
+ mini_obj: bool = True,
23
+ mini_pass: bool = True,
24
+ mini_posargs: bool = True,
25
+ mini_retnone: bool = True,
26
+ mini_shebang: bool = True,
27
+ ):
28
+ return PyTypingMinifier().process_py(
29
+ py_path_or_folder=path_or_folder,
30
+ out_py_folder=out,
31
+ pyi_folder=pyis,
32
+ types=types,
33
+ mini=mini,
34
+ combine_imports=mini_imports,
35
+ convert_posargs_to_args=mini_posargs,
36
+ hoist_literals=mini_lits,
37
+ preserve_shebang=not mini_shebang,
38
+ remove_annotations=mini_annotations,
39
+ remove_asserts=mini_asserts,
40
+ remove_debug=mini_debug,
41
+ remove_explicit_return_none=mini_retnone,
42
+ remove_literal_statements=mini_docs,
43
+ remove_object_base=mini_obj,
44
+ remove_pass=mini_pass,
45
+ rename_globals=mini_globs,
46
+ rename_locals=mini_locs,
47
+ )
48
+
49
+
50
+ def cli():
51
+ fire.core.Display = lambda lines, out: print(*lines, file=out)
52
+ fire.Fire(split_python4gpt)
53
+
54
+
55
+ if __name__ == "__main__":
56
+ cli()
@@ -0,0 +1,146 @@
1
+ #!/usr/bin/env python3.10
2
+
3
+ import contextlib
4
+ import shutil
5
+ import subprocess
6
+ from pathlib import Path
7
+
8
+ from python_minifier import minify
9
+ from pytype.tools.merge_pyi import merge_pyi
10
+
11
+
12
+ class PyTypingMinifier:
13
+ def __init__(self, py_ver="3.10"):
14
+ self.PY_TYPE_PY_VER = py_ver
15
+ self.PY_TYPE_PY_EXE = shutil.which(f"python{self.PY_TYPE_PY_VER}")
16
+ self.py_folder = None
17
+ self.out_py_folder = None
18
+ self.pyi_folder = None
19
+ self.py_path = None
20
+ self.out_py_path = None
21
+ self.pyi_path = None
22
+ self.py_code = None
23
+ self.code_data = {
24
+ "py_path": Path(),
25
+ "pyi_path": Path(),
26
+ "py_code": "",
27
+ }
28
+ self.code_folder_data = {}
29
+
30
+ def init_folders(
31
+ self,
32
+ py_folder: str | Path,
33
+ out_py_folder: str | Path | None = None,
34
+ pyi_folder: str | Path | None = None,
35
+ ):
36
+ self.py_folder = Path(py_folder).resolve()
37
+ self.out_py_folder = (
38
+ Path(out_py_folder).resolve() if out_py_folder else self.py_folder
39
+ )
40
+ self.out_py_folder.mkdir(parents=True, exist_ok=True)
41
+ self.pyi_folder = Path(pyi_folder) if pyi_folder else self.out_py_folder
42
+ self.pyi_folder.mkdir(parents=True, exist_ok=True)
43
+
44
+ def read_py_file(
45
+ self,
46
+ py_path: str | Path,
47
+ out_py_folder: str | Path | None = None,
48
+ pyi_folder: str | Path | None = None,
49
+ ):
50
+ py_path = Path(py_path).resolve()
51
+ self.init_folders(py_path.parent, out_py_folder, pyi_folder)
52
+ out_py_path, code_data = self.init_code_data(py_path)
53
+ self.code_folder_data[out_py_path] = code_data
54
+
55
+ def read_py_folder(
56
+ self,
57
+ py_folder: str | Path,
58
+ out_py_folder: str | Path | None = None,
59
+ pyi_folder: str | Path | None = None,
60
+ ):
61
+ self.init_folders(py_folder, out_py_folder, pyi_folder)
62
+ for py_path in Path(self.py_folder).rglob("*.py"):
63
+ out_py_path, code_data = self.init_code_data(py_path)
64
+ self.code_folder_data[out_py_path] = code_data
65
+
66
+ def init_code_data(
67
+ self,
68
+ py_path: str | Path,
69
+ ):
70
+ py_path = Path(py_path).resolve()
71
+ rel_py_path = Path(py_path).relative_to(self.py_folder)
72
+ out_py_path = Path(self.out_py_folder, rel_py_path)
73
+ out_py_path.parent.mkdir(parents=True, exist_ok=True)
74
+ if out_py_path != py_path:
75
+ shutil.copy2(py_path, out_py_path)
76
+ pyi_path = Path(
77
+ self.pyi_folder, ".pytype", "pyi", out_py_path.with_suffix(".pyi").name
78
+ )
79
+ py_code = out_py_path.read_text()
80
+ code_data = {
81
+ "py_path": py_path,
82
+ "pyi_path": pyi_path,
83
+ "py_code": py_code,
84
+ }
85
+ return out_py_path, code_data
86
+
87
+ def infer_types(
88
+ self, py_path: str | Path, pyi_path: str | Path, py_code: str
89
+ ) -> str:
90
+ with contextlib.suppress(subprocess.CalledProcessError):
91
+ command = [
92
+ self.PY_TYPE_PY_EXE,
93
+ "-m",
94
+ "pytype",
95
+ f"--python-version={self.PY_TYPE_PY_VER}",
96
+ str(py_path),
97
+ ]
98
+ subprocess.run(command, cwd=self.pyi_folder, check=True)
99
+ pyi_code = Path(pyi_path).read_text()
100
+ py_code = merge_pyi.merge_sources(py=py_code, pyi=pyi_code)
101
+ return py_code
102
+
103
+ def minify(self, py_code: str, **custom_minify_options):
104
+ minify_options = {
105
+ "combine_imports": True,
106
+ "convert_posargs_to_args": True,
107
+ "hoist_literals": False,
108
+ "preserve_shebang": False,
109
+ "remove_annotations": False,
110
+ "remove_asserts": True,
111
+ "remove_debug": True,
112
+ "remove_explicit_return_none": True,
113
+ "remove_literal_statements": True,
114
+ "remove_object_base": True,
115
+ "remove_pass": True,
116
+ "rename_globals": False,
117
+ "rename_locals": False,
118
+ } | custom_minify_options
119
+ return minify(py_code, **minify_options)
120
+
121
+ def process_py(
122
+ self,
123
+ py_path_or_folder: str | Path,
124
+ out_py_folder: str | Path | None = None,
125
+ pyi_folder: str | Path | None = None,
126
+ types: bool = True,
127
+ mini: bool = True,
128
+ **minify_options,
129
+ ) -> list[Path]:
130
+ py_path_or_folder = Path(py_path_or_folder).resolve()
131
+ if py_path_or_folder.is_dir():
132
+ self.read_py_folder(py_path_or_folder, out_py_folder, pyi_folder)
133
+ elif py_path_or_folder.is_file():
134
+ self.read_py_file(py_path_or_folder, out_py_folder, pyi_folder)
135
+ else:
136
+ return []
137
+ for out_py_path, code_data in self.code_folder_data.items():
138
+ if types:
139
+ py_code = self.infer_types(
140
+ out_py_path, code_data["pyi_path"], code_data["py_code"]
141
+ )
142
+ if mini:
143
+ py_code = self.minify(py_code, **minify_options)
144
+ code_data["py_code"] = py_code
145
+ out_py_path.write_text(py_code)
146
+ return list(self.code_folder_data.keys())
@@ -0,0 +1,74 @@
1
+ Metadata-Version: 2.1
2
+ Name: split-python4gpt
3
+ Version: 1.0.2
4
+ Summary: Python tool designed to reorganize large Python projects into minified files based on a specified token limit. This is particularly useful for processing large Python projects with GPT models, as it allows the models to handle the data in manageable chunks.
5
+ Home-page: https://github.com/twardoch/split-python4gpt
6
+ Author: Adam Twardoch
7
+ Author-email: adam+github@twardoch.com
8
+ License: Apache-2.0
9
+ Project-URL: Documentation, https://twardoch.github.io/split-python4gpt/
10
+ Project-URL: Source, https://github.com/twardoch/split-python4gpt
11
+ Keywords: python,code-summarization,openai,text-summarization,summarization,code-processing,gpt,data-preprocessing,openai-gpt,gpt-3,gpt-4,gpt-35-turbo,gpt-35-turbo-16k
12
+ Platform: any
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Programming Language :: Python
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Intended Audience :: Science/Research
19
+ Classifier: Topic :: Text Processing
20
+ Classifier: License :: OSI Approved :: Apache Software License
21
+ Classifier: Operating System :: OS Independent
22
+ Requires-Python: <3.11,>=3.10
23
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
24
+ Provides-Extra: testing
25
+ License-File: LICENSE.txt
26
+
27
+ # split_python4gpt
28
+
29
+ `split_python4gpt` is a Python tool designed to reorganize large Python projects into minified files based on a specified token limit. This is particularly useful for processing large Python projects with GPT models, as it allows the models to handle the data in manageable chunks.
30
+
31
+ _**Version 1.0.2** (2023-06-22)_
32
+
33
+ ### NOT IMPLEMENTED YET
34
+
35
+ Warning: The code does not yet implement the splitting or token counting, only type inference and minification. Use at your own risk.
36
+
37
+ ## Installation
38
+
39
+ You can install `split_python4gpt` via pip:
40
+
41
+ ```bash
42
+ pip install split_python4gpt
43
+ ```
44
+
45
+ ## CLI Usage
46
+
47
+ ### This is not yet implemented!
48
+
49
+ After installation, you can use the `pysplit4gpt` or `python3.10 -m split_python4gpt` command to split a Python file. Here's the basic syntax:
50
+
51
+ ```bash
52
+ python3.10 -m split_python4gpt py_path_or_folder --model gpt-3.5-turbo --limit 4096 --separator "=== SPLIT ==="
53
+ ```
54
+
55
+ This command will split the Python file or all Python files in `py_path_or_folder` into sections, each containing no more than 4096 tokens (as counted by the `gpt-3.5-turbo` model). The sections will be separated by `=== SPLIT ===`.
56
+
57
+ ## Python usage
58
+
59
+ - **[See the API documentation](https://twardoch.github.io/split-python4gpt/API.html)** for more advanced usage
60
+
61
+ ## Changelog
62
+
63
+ - v1.0.0: Initial release
64
+
65
+ ## Contributing
66
+
67
+ Contributions to `split_python4gpt` are welcome! Please open an issue or submit a pull request on the [GitHub repository](https://github.com/twardoch/split-python4gpt).
68
+
69
+ ## License
70
+
71
+ - Copyright (c) 2023 [Adam Twardoch](./AUTHORS.md)
72
+ - Written with assistance from ChatGPT
73
+ - Licensed under the [Apache License 2.0](./LICENSE.txt)<a id="split_python4gpt"></a>
74
+
@@ -0,0 +1,27 @@
1
+ .coveragerc
2
+ .gitignore
3
+ .isort.cfg
4
+ .pre-commit-config.yaml
5
+ AUTHORS.md
6
+ LICENSE.txt
7
+ README.md
8
+ pydoc-markdown.yml
9
+ pyproject.toml
10
+ setup.cfg
11
+ setup.py
12
+ tox.ini
13
+ .github/workflows/ci.yml
14
+ src/split_python4gpt/__init__.py
15
+ src/split_python4gpt/__main__.py
16
+ src/split_python4gpt/minifier.py
17
+ src/split_python4gpt.egg-info/PKG-INFO
18
+ src/split_python4gpt.egg-info/SOURCES.txt
19
+ src/split_python4gpt.egg-info/dependency_links.txt
20
+ src/split_python4gpt.egg-info/entry_points.txt
21
+ src/split_python4gpt.egg-info/not-zip-safe
22
+ src/split_python4gpt.egg-info/requires.txt
23
+ src/split_python4gpt.egg-info/top_level.txt
24
+ tests/conftest.py
25
+ tests/test_minifier.py
26
+ tests/data/in_test.py
27
+ tests/data/out_test.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ mdsplit4gpt = split_python4gpt.__main__:cli
@@ -0,0 +1,9 @@
1
+ fire>=0.5.0
2
+ tiktoken>=0.4.0
3
+ python-minifier>=2.9.0
4
+ pytype>=2023.6.16
5
+
6
+ [testing]
7
+ setuptools
8
+ pytest
9
+ pytest-cov
@@ -0,0 +1 @@
1
+ split_python4gpt
@@ -0,0 +1,10 @@
1
+ """
2
+ Dummy conftest.py for split_python4gpt.
3
+
4
+ If you don't know what this is for, just leave it empty.
5
+ Read more about conftest.py under:
6
+ - https://docs.pytest.org/en/stable/fixture.html
7
+ - https://docs.pytest.org/en/stable/writing_plugins.html
8
+ """
9
+
10
+ # import pytest
@@ -0,0 +1,2 @@
1
+ def hello_name(name):
2
+ print(f"Hello, {name}!")
@@ -0,0 +1 @@
1
+ def hello_name(name):print(f"Hello, {name}!")
@@ -0,0 +1,18 @@
1
+ import pytest
2
+ from split_python4gpt.minifier import PyTypingMinifier
3
+ from pathlib import Path
4
+
5
+
6
+ @pytest.fixture
7
+ def minifier():
8
+ return PyTypingMinifier()
9
+
10
+
11
+ def test_minify_code(minifier):
12
+ # Test if the minify method returns the expected result
13
+ in_code = Path(Path(__file__).parent / "data" / "in_test.py").read_text()
14
+ out_code = Path(Path(__file__).parent / "data" / "out_test.py").read_text()
15
+
16
+ minified_code = minifier.minify(in_code)
17
+
18
+ assert minified_code == out_code
@@ -0,0 +1,93 @@
1
+ # Tox configuration file
2
+ # Read more under https://tox.wiki/
3
+ # THIS SCRIPT IS SUPPOSED TO BE AN EXAMPLE. MODIFY IT ACCORDING TO YOUR NEEDS!
4
+
5
+ [tox]
6
+ minversion = 3.24
7
+ envlist = default
8
+ isolated_build = True
9
+
10
+
11
+ [testenv]
12
+ description = Invoke pytest to run automated tests
13
+ setenv =
14
+ TOXINIDIR = {toxinidir}
15
+ passenv =
16
+ HOME
17
+ SETUPTOOLS_*
18
+ extras =
19
+ testing
20
+ commands =
21
+ pytest {posargs}
22
+
23
+
24
+ # # To run `tox -e lint` you need to make sure you have a
25
+ # # `.pre-commit-config.yaml` file. See https://pre-commit.com
26
+ # [testenv:lint]
27
+ # description = Perform static analysis and style checks
28
+ # skip_install = True
29
+ # deps = pre-commit
30
+ # passenv =
31
+ # HOMEPATH
32
+ # PROGRAMDATA
33
+ # SETUPTOOLS_*
34
+ # commands =
35
+ # pre-commit run --all-files {posargs:--show-diff-on-failure}
36
+
37
+
38
+ [testenv:{build,clean}]
39
+ description =
40
+ build: Build the package in isolation according to PEP517, see https://github.com/pypa/build
41
+ clean: Remove old distribution files and temporary build artifacts (./build and ./dist)
42
+ # https://setuptools.pypa.io/en/stable/build_meta.html#how-to-use-it
43
+ skip_install = True
44
+ changedir = {toxinidir}
45
+ deps =
46
+ build: build[virtualenv]
47
+ passenv =
48
+ SETUPTOOLS_*
49
+ commands =
50
+ clean: python -c 'import shutil; [shutil.rmtree(p, True) for p in ("build", "dist", "docs/_build")]'
51
+ clean: python -c 'import pathlib, shutil; [shutil.rmtree(p, True) for p in pathlib.Path("src").glob("*.egg-info")]'
52
+ build: python -m build {posargs}
53
+ # By default, both `sdist` and `wheel` are built. If your sdist is too big or you don't want
54
+ # to make it available, consider running: `tox -e build -- --wheel`
55
+
56
+
57
+ [testenv:{docs,doctests,linkcheck}]
58
+ description =
59
+ docs: Invoke sphinx-build to build the docs
60
+ doctests: Invoke sphinx-build to run doctests
61
+ linkcheck: Check for broken links in the documentation
62
+ passenv =
63
+ SETUPTOOLS_*
64
+ setenv =
65
+ DOCSDIR = {toxinidir}/docs
66
+ BUILDDIR = {toxinidir}/docs/_build
67
+ docs: BUILD = html
68
+ doctests: BUILD = doctest
69
+ linkcheck: BUILD = linkcheck
70
+ deps =
71
+ -r {toxinidir}/docs/requirements.txt
72
+ # ^ requirements.txt shared with Read The Docs
73
+ commands =
74
+ sphinx-build --color -b {env:BUILD} -d "{env:BUILDDIR}/doctrees" "{env:DOCSDIR}" "{env:BUILDDIR}/{env:BUILD}" {posargs}
75
+
76
+
77
+ [testenv:publish]
78
+ description =
79
+ Publish the package you have been developing to a package index server.
80
+ By default, it uses testpypi. If you really want to publish your package
81
+ to be publicly accessible in PyPI, use the `-- --repository pypi` option.
82
+ skip_install = True
83
+ changedir = {toxinidir}
84
+ passenv =
85
+ # See: https://twine.readthedocs.io/en/latest/
86
+ TWINE_USERNAME
87
+ TWINE_PASSWORD
88
+ TWINE_REPOSITORY
89
+ TWINE_REPOSITORY_URL
90
+ deps = twine
91
+ commands =
92
+ python -m twine check dist/*
93
+ python -m twine upload {posargs:--repository {env:TWINE_REPOSITORY:testpypi}} dist/*