-
Notifications
You must be signed in to change notification settings - Fork 0
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
Initiail commit for Repo Score v2 #9
Conversation
You could see all code tree in https://github.com/kunpengcompute/reposcore/tree/d448a023558232ba6daf295dbbe552f6aeb75cc6 I do a prerelease in to pypi, you could just use
have a try. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
‘格式可以参考本项目reposcore目录下的projects.txt文件’ 这句话去掉,中英文都是
The Repo Score v1 is forked from criticality_score and had much not graceful modification on upstream code, after the discussion[1], we decided to decouple the dependency of criticality_score. So in this patch, we keep the v1 code and doc unchanged, only move the criticality_score into requirements, set the setup version to 2.0.0 to avoid the pypi reupload problem[2]. [1] #1 [2] pypa/packaging-problems#74 Close: #1
@zhaorenhai done |
|
||
setuptools.setup( | ||
name='reposcore', | ||
version='2.0.0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接是2.0版本?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,1.0是原实现,2.0是新实现。:)主要是1.0在pypi发布后,不能再次发布了。。。即使删除也不行,pypa/packaging-problems#74
'criticality_score', | ||
'PyGithub>=1.53', | ||
'python-gitlab>=2.5.0', | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- criticality_score也要指定版本吧
- PyGithub和python-gitlab是间接依赖,不需要写
- 这里与requirements.txt是否重复? https://packaging.python.org/discussions/install-requires-vs-requirements/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1、2写criticality_score指定版本就可以了。在这跟踪#10
- 不重复,你的链接里面也说了一些原因,学习了,对于咱们这个项目来说:
setup是用于打包的,确保setup dist的时候能把依赖打上。
requirements.txt,如果有人想自己测试的话,问了不把所有依赖都写上,希望他可以使用pip install -r requirements.txt去安装。
import sys | ||
import time | ||
|
||
from criticality_score import run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from criticality_score import run as cs_run
纯import run这种,不利于代码维护
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run.COMMIT_FREQUENCY_WEIGHT = 4 | ||
run.COMMENT_FREQUENCY_WEIGHT = 0.5 | ||
run.DEPENDENTS_COUNT_WEIGHT = 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不建议直接修改第三方组件的内容,建议使用继承方式
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
主要是底下run会直接调用这个参数修改,upstream的接口定义的不好。
后面会在#8 闭环这个问题
run.DEPENDENTS_COUNT_WEIGHT = 1 | ||
|
||
|
||
def main(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
整体代码建议使用类的方式,方便后续更新
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Repo Score v1 is forked from criticality_score and had much not graceful modification on upstream code, after the discussion[1], we decided to decouple the dependency of criticality_score.
So in this patch, we keep the v1 code and doc unchanged, only move the criticality_score into requirements, and then set the
setup.py
version to 2.0.0 to avoid the pypi reupload problem [2].[1] #1
[2] pypa/packaging-problems#74
Close: #1