Expose all .whl,.ABOUT, .NOTICE,.LICENCE files and Create an archive - #2117
Conversation
ee13ae6 to
a1c0500
Compare
It will upload all .whl,.ABOUT, .NOTICE,.LICENCE files of thirdparty repo to github new repo as an asset of specific OS and python 3 version and also generate archive for each Oses and all python and release them an asset on github. Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
a1c0500 to
f08eacf
Compare
steven-esser
left a comment
There was a problem hiding this comment.
Can we put these in etc/scripts/ like in #2118?
Yes, you can run from anywhere no problem |
pombredanne
left a comment
There was a problem hiding this comment.
Looking good!
I have a few nitpickings for your consideration
| """ | ||
| Generate an archive for dependencies for specific OS and | ||
| given version of python by taking directory as an input. | ||
| """ |
There was a problem hiding this comment.
Can you remind me why and how this archive would be used?
There was a problem hiding this comment.
It will generate an archive for each os and each python. For example - macOS_py36.tar.gz, win3_py36.zip, win64_py.36zip, linux_py36.tar.gz . For more info see PR description
There was a problem hiding this comment.
I still do not know what these archives will be used for.... Are you saying that you plan to upload one such archive per OS/Python/scancode version to a GH release?
That archive will not be usable as a pip find-link then. And if there are dupes between OSes... that is going to be problematic. The archives we want to upload would be something built with etc/release/ scripts instead... e.g. full sdist with a streamlined thirparty
There was a problem hiding this comment.
But you said earlier One archive for each OS/Python combo should be created and each should have its exact set of pinned requirements included in the built archive, no more and no less.
There was a problem hiding this comment.
Yes, but I would prefer to have the sdist being use for these archives that's using a proper manifest and does not include things we do not want there. For this you should expand on the release script instead
There was a problem hiding this comment.
FYI , this will give you 1 directory along with tar.gz ,if you are on linux /macOS.
if you are on window, you get 1 directory along with zip.
BTW i got directory of wheels of 30.1 MB and tar.gz of 28 MB on my macOS.
Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
e0ee198 to
89e957e
Compare
Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
| from __future__ import print_function | ||
|
|
||
| import argparse | ||
| from commoncode.system import on_windows |
There was a problem hiding this comment.
Sort your imports: commoncode is not from the stdlib, but our own code and should go in a separate block.
See for instance https://github.com/nexB/scancode-toolkit/blob/develop/src/packagedcode/cargo.py#L36
| deps_archive.py \\ | ||
| --input thirdparty \\ | ||
| --req requirements.txt | ||
| --output_file macOS_py36 \\ |
There was a problem hiding this comment.
Please remove that as it does help readability.
Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
| root_dir = os.path.abspath(archive_name) | ||
| output_dir = os.path.abspath(archive_name) | ||
| if on_windows: | ||
| make_archive(output_dir, 'zip', root_dir) |
There was a problem hiding this comment.
I am stil not clear about what these archives wrt. to what we need as sdist
There was a problem hiding this comment.
here you get all wheel/sdist deps packed like sdist file that required for ur python/os.
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Do not spawn a process but call a function instead. Clarify variable and options names and their help text. Use access token from a cli option or an environment variable. Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
2e6a01f to
c062d21
Compare
| from __future__ import print_function | ||
|
|
||
| import argparse | ||
| from fnmatch import fnmatchcase |
|
|
||
| from commoncode.fileutils import resource_iter | ||
|
|
||
| python_version = str(sys.version_info[0]) + str(sys.version_info[1]) |
There was a problem hiding this comment.
Why remove this section ,it will help you filter the python 3 files if your directory contains multiple python deps.
| or fnmatchcase(files, py_abi) | ||
| or ( | ||
| fnmatchcase(files, '*tar.gz*') | ||
| and not fnmatchcase(files, '*py2-ipaddress-3.4.1.tar.gz*') |
There was a problem hiding this comment.
It will upload unwanted file also
| '--body-string', | ||
| help='Required : Text describing the release. Ignored if the release already exists.', | ||
| '--token', | ||
| help=TOKEN_HELP, |
|
|
||
|
|
||
| def main_with_args(args: str) -> None: | ||
| api = grr.GithubApi( |
There was a problem hiding this comment.
Either you call API or cmd . result will be same.
| help='Text description for the release. Ignored if the release exists.', | ||
| type=str, | ||
| default='10', | ||
| required=False, |
There was a problem hiding this comment.
no need to mention that
| help=TOKEN_HELP, | ||
| type=str, | ||
| required=True, | ||
| required=False, |
There was a problem hiding this comment.
no need to mention, by default it is false
|
|
||
|
|
||
| def main() -> None: | ||
| def main(): |
There was a problem hiding this comment.
Why you remove anotations?
pombredanne
left a comment
There was a problem hiding this comment.
I am still not 100% clear about the deps archive and these will be used. But I am merging now so we can get a clearer picture and improve from that base.
It will upload all
.whl,.ABOUT,.NOTICE,.LICENCEfiles of thirdparty repo to new repo as an asset of specific OS and python and also generate archive for each Oses and all pythonRelease them as asset on Github for #2136
Signed-off-by: Abhishek Kumar abhishek.kasyap09@gmail.com
Fixes #2068 aboutcode-org/skeleton#50 #2072