Skip to content
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

Merged
merged 1 commit into from
Jan 8, 2021
Merged

Initiail commit for Repo Score v2 #9

merged 1 commit into from
Jan 8, 2021

Conversation

Yikun
Copy link
Owner

@Yikun Yikun commented Jan 8, 2021

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

@Yikun
Copy link
Owner Author

Yikun commented Jan 8, 2021

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

pip install reposcore
echo "https://github.com/kunpengcompute/score_projects" > input.txt
reposcore --projects_list ./input.txt  --result_file result.csv

have a try.

Copy link
Contributor

@zhaorenhai zhaorenhai left a 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
@Yikun
Copy link
Owner Author

Yikun commented Jan 8, 2021

@zhaorenhai done

@zhaorenhai zhaorenhai merged this pull request into main Jan 8, 2021

setuptools.setup(
name='reposcore',
version='2.0.0',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接是2.0版本?

Copy link
Owner Author

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',
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. criticality_score也要指定版本吧
  2. PyGithub和python-gitlab是间接依赖,不需要写
  3. 这里与requirements.txt是否重复? https://packaging.python.org/discussions/install-requires-vs-requirements/

Copy link
Owner Author

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

  1. 不重复,你的链接里面也说了一些原因,学习了,对于咱们这个项目来说:

setup是用于打包的,确保setup dist的时候能把依赖打上。
requirements.txt,如果有人想自己测试的话,问了不把所有依赖都写上,希望他可以使用pip install -r requirements.txt去安装。

import sys
import time

from criticality_score import run
Copy link
Contributor

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这种,不利于代码维护

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#11

run.COMMIT_FREQUENCY_WEIGHT = 4
run.COMMENT_FREQUENCY_WEIGHT = 0.5
run.DEPENDENTS_COUNT_WEIGHT = 1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不建议直接修改第三方组件的内容,建议使用继承方式

Copy link
Owner Author

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():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

整体代码建议使用类的方式,方便后续更新

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#11

@Yikun Yikun deleted the dev branch January 8, 2021 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[arch] 自研代码与上游criticality_score代码分离
3 participants