├── Assignments ├── Lab1.md ├── Lab2.md ├── Lab3.md ├── Lab4.md ├── Lab4 │ ├── .gitignore │ ├── pygraph.py │ ├── pyproject.toml │ ├── pytest.ini │ └── tests │ │ ├── conftest.py │ │ ├── test_manipulation.py │ │ └── test_metrics.py ├── Lab5.md ├── Lab6.md ├── Project.md ├── README.md └── Report │ ├── .gitignore │ ├── LICENSE │ ├── elegantpaper.cls │ ├── main.pdf │ ├── main.tex │ └── references.bib ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CONTRIBUTORS.md ├── LICENSE ├── Projects.md ├── PublicizingMaterials ├── README.md └── 用开源教开源:“开源软件开发”课程-20210716-zhmh.pdf ├── README.md ├── Slides ├── lecture1-开源和生态及其研究介绍.pdf ├── lecture201-Git教程.pdf ├── lecture202-使用GitHub进行项目托管.pdf ├── lecture301-贡献指南.pdf ├── lecture701-CI&CD&Devops.pdf └── readme.txt └── Syllabus.md /Assignments/Lab1.md: -------------------------------------------------------------------------------- 1 | # Lab 1:熟悉git和GitHub(7分) 2 | 3 | **截止日期:2024.10.03 11:59am** 4 | 5 | ## 实践目的 6 | 7 | 熟悉开源软件开发中常用的工具、平台、和开发流程;为课程学习确立初步计划和目标。 8 | 9 | ## 实践流程 10 | 11 | 1. 如果你还没有GitHub账号,请注册一个GitHub账号。 12 | 2. 将GitHub账号以填写[表单](https://docs.qq.com/form/page/DUnd3eEdaYlpEREhp)形式发给助教,助教发送GitHub邀请到[OSS-Dev-Course-PKU](https://github.com/OSS-Dev-Course-PKU)组织,Lab 1、Lab 4和Lab5中涉及操作GitHub的部分均会在此进行;此外,后续的课程项目也会以此处告知的GitHub账号为准进行评分。 13 | 3. 在[OSS-Dev-Course-PKU](https://github.com/OSS-Dev-Course-PKU)中创建一个GitHub仓库,名为`2024Fall-{学号}-Lab1`。 14 | > 例如,如果学号为2200012345,那么仓库名应当为`2024Fall-2200012345-Lab1`。 15 | 16 | 4. 在自己的个人电脑上安装git,初始化一个git repository。 17 | > 网上存在大量关于如何在Windows/Mac OS/Linux安装git、初始化git repository、和添加commit的教程,我们在此推荐[MIT的Git教程](https://missing.csail.mit.edu/2020/version-control/)和[Pro Git前五章](https://git-scm.com/book/en/v2),也可自行搜索参考其他教程,在此不再赘述;除命令行外,VS Code等IDE也提供非常便捷的git操作GUI。 18 | 19 | 5. 在repository中创建README.md文件,在文件中描述自己目前对开源项目的贡献想法,为本学期的课程学习设定目标。 20 | 21 | 6. 在一个新的commit中添加README.md进入git仓库,这个commit的commit message应当为`Add README.md with my OSS contribution plan`。 22 | > 为了保证软件项目的可维护性,特别是为了方便他人查看和理解一个项目的开发历史,commit message的最低要求通常是**能够简明扼要地总结这个commit所包含的变更**。对于大型项目而言,往往还会对commit message格式做出更加严格的要求,例如[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/),方便对commit进行自动化管理。 23 | 24 | 7. 将这个repository上传到[OSS-Dev-Course-PKU](https://github.com/OSS-Dev-Course-PKU)中你创建的GitHub仓库。 25 | 26 | 8. (建议上过一周课程后再继续这一步)相比较于上一次,你的贡献想法和计划发生了什么变化?请在你创建的GitHub仓库中开启一个issue,用一句话描述贡献想法和计划的变化。 27 | > 在真实的开源项目中,Issue和PR的内容通常会有规定的[模板](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/about-issue-and-pull-request-templates),以便于维护者快速地处理新的Issue和PR;在本Lab中,因为相关的issue和PR过于trivial,故不对内容作任何要求;但是需要额外注意,如果在真实的开源项目中提交issue和PR,通常需要严格遵循其规定的贡献指南。之后的Lab中涉及到对成熟开源项目的贡献指南的观察和分析。 28 | 29 | 9. 将你创建的GitHub仓库fork到你自己的账号下,新建一个分支,并在新分支中添加一个或者多个新commit,将想法的变化更新在README.md中,随后回到[OSS-Dev-Course-PKU](https://github.com/OSS-Dev-Course-PKU)中你创建的GitHub仓库,删除其中README.md的内容并提交删除commit。此时,在你创建的GitHub仓库中开启一个PR,将fork仓库中的新分支合并入[OSS-Dev-Course-PKU](https://github.com/OSS-Dev-Course-PKU)中仓库的主分支main,解决存在的冲突,设置reviewer为助教,等待助教合并PR。 30 | > 在Lab 1中,你有直接合并PR的权限;在真实的开源项目中,通常只有核心维护者具有PR合并权限,需要通过一轮或多轮[Code Review](https://en.wikipedia.org/wiki/Code_review),才能合并PR里的变更;此外,开源项目在开发过程中通常会选择在不同的[分支](https://docs.github.com/zh/desktop/making-changes-in-a-branch/managing-branches-in-github-desktop)中同步完成不同的开发工作从而使得不同的开发互不影响,但在合并分支的过程中,如果仓库内的不同分支同时对相同文件进行了更改,通常会产生conflicts,此时需要人为进行检查[解决合并冲突](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/about-merge-conflicts),才能合并以获取分支中的最新更改。 31 | 32 | ## 评分标准 33 | 34 | - (1分)按要求创建了repository。 35 | - (1分)Repository中有README.md,按要求书写了commit message。 36 | - (1分)README.md有开源项目的贡献想法和计划。 37 | - (1分)按要求open issue。 38 | - (1分)按要求fork repository、新建分支并在fork仓库的新分支与原仓库的主分支中同时提交commit修改。 39 | - (1分)按要求提交PR合并分支并解决产生的conflicts。 40 | - (1分)贡献想法体现出了对开源项目的了解和自己的认真思考。 41 | 42 | 对于每一项评分标准,超过DDL的提交统一不得分。 43 | 44 | ## 提交方式 45 | 46 | Lab 1无需特意提交任何内容,助教会在DDL后检查[OSS-Dev-Course-PKU](https://github.com/OSS-Dev-Course-PKU)中是否存在相应仓库、README.md、fork/PR合并记录、和贡献想法,做出最终评分。 47 | 48 | ## 备注 49 | 50 | 1. Lab 1中所涉及的git操作相对基础,在真实的开源项目中可能会涉及到比较复杂的git操作(例如rebase/squash/submodule等);因此,虽然Lab 1不对此作强制的评分要求,但是我们强烈建议,如果你对git仍不熟悉,可以自己过一遍[MIT的Git教程](https://missing.csail.mit.edu/2020/version-control/)并做一做附带的练习,以免在之后的课程项目中遭遇困难。 51 | 2. 若上述操作流程中存在误操作,或者需要修改贡献想法,自行重新提交即可,只要仓库历史上存在一个符合要求的commit、issue、fork、PR,即符合得分要求。 52 | 3. 在评分标准中,贡献想法的长度**不会**作为评分的参考,简明扼要即可;评分的最终解释权归助教所有。 53 | 4. 结课后,(大概率在明年开课前)助教可能会删除[OSS-Dev-Course-PKU](https://github.com/OSS-Dev-Course-PKU)创建的所有repository,如果有需要,请本地保存您提交的相关内容的备份 54 | -------------------------------------------------------------------------------- /Assignments/Lab2.md: -------------------------------------------------------------------------------- 1 | # Lab 2: 了解开源项目的开发方式和贡献流程(7分) 2 | 3 | **截止日期:2024.10.10 11:59am** 4 | 5 | ## 实践目的 6 | 7 | 初步确立一个有贡献意愿的开源项目;了解这个开源项目的贡献指南、开发环境、质量管理方式、issue管理方式等基本情况,熟悉贡献一个开源项目前需要做的准备工作,为开发任务的选择做准备。 8 | 9 | ## 实践流程 10 | 11 | > (2分)请列出一个你想要贡献的开源项目,提供项目的链接,用一句话简要介绍一下这是个什么开源项目,并简要回答如下问题: 12 | > - 这个项目是一个活跃的开源项目么?为什么? 13 | > - 这个项目是一个成熟的开源项目么?为什么? 14 | > - 你为什么想要对这个开源项目做贡献? 15 | 16 | (在这里写下你的回答) 17 | 18 | > (2分)请找到并阅读这个项目的贡献指南(如项目内[CONTRIBUTING.md](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/setting-guidelines-for-repository-contributors)等),提供贡献指南的链接,并简要回答如下问题: 19 | > - 这个项目的贡献指南包含了哪些内容? 20 | > - 有哪些为这个开源项目提出改进建议的方式? 21 | > - 有哪些为这个开源项目做出贡献的方式? 22 | 23 | (在这里写下你的回答) 24 | 25 | > (3分)请尝试找到这个项目的开发文档,提供开发文档的链接,按照开发文档的描述在你的机器上配置开发环境,并简要回答如下问题: 26 | > - 这个项目是否规定了统一代码风格?采用了什么自动化工具来执行规定的代码风格? 27 | > - 这个项目有哪些测试?采用了什么测试框架(如Python的[pytest](https://docs.pytest.org/en/7.4.x/))来运行测试? 28 | > - 这个项目是否配置了CI/CD流水线(例如,[GitHub Actions](https://docs.github.com/en/actions),注意GitHub上commit边上的小绿勾)?流水线中包含了哪些检查? 29 | > - 你能否在你的机器上成功构建并运行测试?如果是,请提供一些输出结果(可附截图);如果否,请试图解释原因 30 | 31 | (在这里写下你的回答) 32 | 33 | ## 提交方式 34 | 35 | 请在截止日期之前,将此markdown文件(请检查前面的问题是不是已经都回答了)发送到助教邮箱(xuww@stu.pku.edu.cn),文件命名统一为`学号-姓名-Lab2.md`(例如`2201110012-张三-Lab2.md`)。 36 | 37 | ## 评分标准 38 | 39 | 对实践流程中提出的每一块问题,均有合理的回答即得满分,否则酌情扣分。 40 | 41 | 提交超出截止日期24小时内,最多获得80%的分数;提交超出截止日期72小时内,最多获得50%的分数;超出截止日期72小时的提交不得分。 42 | 43 | ## 备注 44 | 45 | 1. 如果一些问题不适用于你选择的开源项目,解释一下为什么不适用,并跳过此问题即可。 46 | 2. 一个正经的软件项目(当然包括大多数开源项目!)通常都会采用以下方式来保证代码的正确性和质量: 47 | - [静态分析](https://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis):简单地说,静态分析工具通过对代码运行特定的算法,来检查代码是否存在常见的质量问题,或者将代码自动格式化成统一的格式(便于维护),典型的工具有Java的[FindBug](http://findbugs.sourceforge.net/)、Python的[black](https://black.readthedocs.io/en/stable/)、等等。 48 | - [软件测试](https://en.wikipedia.org/wiki/Software_testing):简单地说,软件测试就是通过一组专门编写的程序(i.e., 测试用例)来验证软件项目的核心代码的正确性。通常项目都会使用某些开源测试框架(例如,[JUnit](https://junit.org/junit5/)、[pytest](https://docs.pytest.org/en/7.1.x/)、等等),简化编写测试用例和运行复杂测试的过程。 49 | - [持续集成/持续部署(CI/CD)](https://en.wikipedia.org/wiki/Continuous_integration):CI是指在代码提交到云端后,在一系列预先配置好的虚拟机环境下运行一系列自动化脚本,对代码库的整体质量进行检查,避免引入bug;CD是在这一步的基础上,自动化地将程序发布/部署到特定的位置;通常CI和CD会在一起配置成一个由脚本组成的流水线。常见的流水线脚本包括代码静态分析、软件测试(单元测试、集成测试、...)、自动部署(自动发布)、等等。 50 | 3. 请注意为开源项目配置开发环境所花的时间可能难以预估,请务必尽早开始。 51 | 52 | 53 | -------------------------------------------------------------------------------- /Assignments/Lab3.md: -------------------------------------------------------------------------------- 1 | # Lab 3:在开源项目中选择开发任务(8分) 2 | 3 | **截止日期:2024.11.14 11:59am** 4 | 5 | ## 实践目的 6 | 7 | 了解开源项目的issue管理机制和吸引外部贡献者的机制,尝试定位可以解决的开发任务。 8 | 9 | ## 实践流程 10 | 11 | 对Lab 2中选择的开源项目或者任意其他开源项目(按照相同规则选择的项目): 12 | > (3分)请尝试搜索这个项目的贡献指南、issue tracker、和其他项目文档,并简要回答如下问题: 13 | > - 这个项目是否有记录其issue管理方式的文档?如果有,给出链接并总结其内容。 14 | > - 这个项目是否采用某种方式标记出难度较低的,适合新人解决的issue? 15 | > - 如果有标记适合新人解决的issue,这些issue被解决的大致情况如何? 16 | 17 | 18 | (在这里写下你的回答) 19 | 20 | > (3分)请尝试搜索这个项目的贡献指南、issue tracker、和其他项目文档,并简要回答如下问题: 21 | > - 对于那些标记了适合新人解决的issue,你认为你能解决哪些(大概解释为什么可以,并提供链接,举例即可)?不能解决哪些(提供链接,举例即可)?不能解决的大概是缺乏什么知识? 22 | > - 如果你有一个改进这个软件的想法(例如增加一个新功能),需要怎么做才能让社区接收你的贡献代码? 23 | 24 | 25 | (在这里写下你的回答) 26 | 27 | > (2分)请描述一个你想要做的具体开发任务。如果已经有进展,也可一并写出。 28 | 29 | (在这里写下你的回答) 30 | 31 | ## 提交方式 32 | 33 | 请在截止日期之前,将此markdown文件(请检查前面的问题是不是已经都回答了)发送到助教邮箱(xuww@stu.pku.edu.cn),文件命名统一为`学号-姓名-Lab3.md`。 34 | 35 | ## 评分标准 36 | 37 | 对实践流程中提出的所有问题,均有合理的回答即得满分,否则酌情扣分。 38 | 39 | 提交超出截止日期24小时内,最多获得80%的分数;提交超出截止日期72小时内,最多获得50%的分数;超出截止日期72小时的提交不得分。 40 | 41 | ## 备注 42 | 43 | 1. 如果一些问题不适用于你选择的开源项目,解释一下为什么不适用,并跳过此问题即可 44 | -------------------------------------------------------------------------------- /Assignments/Lab4.md: -------------------------------------------------------------------------------- 1 | # Lab 4:CI/CD流水线搭建(10分) 2 | 3 | **截止日期:2023.11.21 11:59am** 4 | 5 | ## 实践目的 6 | 7 | * 了解使用GitHub Action搭建CI/CD流水线的基本方法。 8 | * 以Python为例,了解典型的软件项目应当具有的基本开发工具、框架和流程。 9 | 10 | ## 初始文件 11 | 12 | [Lab4/](Lab4/)文件夹中是一个功能极简的用Python实现图数据结构的包`pygraph`,该项目目前采用[Poetry](https://python-poetry.org/)进行依赖管理,[pytest](https://docs.pytest.org/en/7.1.x/)作为测试框架,文件结构如下: 13 | 14 | * `pygraph.py`实现图数据结构,包含一个类和一些简单函数,均未实现,且结构混乱。 15 | * `pyproject.toml`是Poetry使用的依赖配置文件,文件中声明了本项目支持的Python版本(**仅支持Python 3.10**),以及本Lab中需要的各种开发依赖。 16 | * `tests/`文件夹包含若干测试。 17 | * `pytest.ini`是`pytest`的配置文件。 18 | 19 | Lab 4需要为这个项目配置开发环境,补全未实现的代码,并配置一个包含所有常见阶段的CI/CD流水线。 20 | 21 | ## 实践流程 22 | 23 | 1. 请在[OSS-Dev-Course-PKU](https://github.com/OSS-Dev-Course-PKU)中创建一个**私有**GitHub仓库,名为`2024Fall-{学号}-Lab4`,为老师和助教添加访问权限,并将[Lab4/](Lab4/)文件夹中的所有文件push到仓库内(注意不是push文件夹本身)。 24 | 25 | > 不要设置为公开仓库或者为其他同学添加访问权限,否则此Lab评分作废;若误操作,请联系助教删除仓库 26 | 27 | 2. 将新创建的仓库clone到本地,配置Python开发环境,安装Poetry,使用Poetry配置虚拟环境,并安装所有依赖。 28 | 29 | ```shell script 30 | # 若Python和Poetry配置正确,用如下两行命令即可配置虚拟环境并安装所有依赖 31 | poetry shell 32 | poetry install 33 | ``` 34 | 35 | 3. 使用[black](https://black.readthedocs.io/en/stable/)对代码进行重新格式化。 36 | 37 | ```shell script 38 | black . 39 | ``` 40 | 41 | 4. 使用[pre-commit](https://pre-commit.com/)工具为项目添加Pre-Commit Hook,使得git能够在commit前,调用black对代码进行自动格式化。这需要涉及到编写一个`.pre-commit-config.yaml`文件,并运行`pre-commit install`命令。 42 | 43 | > 为项目配置统一、简洁的代码风格,是为了降低其他人阅读代码时的认知负荷,方便团队协作。这一流程可以利用现有工具高度自动化,不会为开发带来任何额外负担。 44 | 45 | 5. 修改`pygraph.py`文件,实现其中所有功能,保证运行如下命令可以通过所有测试,并生成测试覆盖率报告。 46 | 47 | ```shell script 48 | pytest -r P --cov=pygraph 49 | ``` 50 | 51 | > 这里采用的开发范式是[测试驱动开发](https://en.wikipedia.org/wiki/Test-driven_development)(Test-Driven Development,TDD),先通过编写测试用例精准描述需求,再在测试用例的基础上实现代码。这一开发方式可以“倒逼”程序员思考代码实现的简洁性、灵活性和可测试性,有助于提升项目代码质量,在敏捷开发中经常使用。 52 | 53 | > 由于本Lab的核心要点并不在于代码实现,因此这里刻意使用了非常简单的代码。不过需要注意,Lab里涉及到的代码实践可适用于,且往往对于长期维护的大型软件项目不可或缺。我们强烈鼓励同学们在自己的其他项目中借鉴运用相关实践(对于各种技术栈,其内核都是相通的),提升整体的工程水平。 54 | 55 | 6. 使用[pdoc3](https://pdoc3.github.io/pdoc/)为`pygraph`自动生成API文档,可以在`html/`文件夹中查看生成的API文档。 56 | 57 | ```shell script 58 | pdoc --html pygraph 59 | ``` 60 | 61 | 7. 使用GitHub Action配置五阶段CI/CD流水线,包含如下步骤: 62 | 63 | * 初始化Python环境,安装Poetry; 64 | * 使用Poetry自动安装所有依赖; 65 | * 使用black检测代码是否存在格式问题; 66 | * 使用pytest运行单元测试; 67 | * 使用pdoc3生成API文档,并将API文档部署到仓库中的`gh-page`分支。 68 | 69 | > 对于公有仓库,可以配置GitHub读取`gh-page`分支,在github.io直接提供相应的公开可访问的网页,这样便实现了API文档的持续部署(对于软件包本身的持续部署,我们留到Lab 5再实现)。 70 | > 71 | > 不过非常遗憾的是,私有仓库的GitHub Page是收费功能。如果同学们以后创建自己的项目,可以尝试用同样的方法自动部署各种网页,确认实际效果。 72 | 73 | > 需要注意CI环境里是不能使用`poetry shell`的([相关讨论](https://github.com/python-poetry/poetry/discussions/3526))。 74 | 75 | 8. 将所有更改体现在GitHub仓库中。 76 | 77 | ## 提交前检查 78 | 79 | 在提交前,请确保在一台安装了Python和Poetry的机器上,能够依次运行如下命令并正常输出结果 80 | 81 | ```shell script 82 | poetry shell # activate a working virtual environment 83 | poetry install # install all dependencies 84 | pre-commit install # install pre-commit hooks 85 | black . # lint all Python code 86 | pytest -r P --cov=pygraph # run all tests with test stdout and coverage report 87 | pdoc --html pygraph # build API documentation and deploy to html/ 88 | ``` 89 | 90 | > 对于所有需要给别人使用的代码,确保其他人能够轻松地按照开发文档,配置能够运行你的代码的标准化的开发环境,是至关重要的。Python生态里的大量工具链都是为了能够做到这一点。 91 | 92 | 此外,请确保你的GitHub仓库里,GitHub Action包含了所有要求的流水线阶段,且能不报错正常执行(有小绿勾)。 93 | 94 | > 助教会人工检查流水线配置是否正确。需要尤其注意的是,`black`在默认配置下,即使存在代码格式问题,也只会重新格式化而不会报错,这对于CI流水线中的检查是不合适的(CI环境下重新格式化了也没用)。因此,需要通过相应配置选项让`black`检查是否存在风格错误。 95 | 96 | ## 评分标准 97 | 98 | - (3分)所有测试能够通过。 99 | - (2分)配置了能够自动格式化代码的Pre-Commit Hook。 100 | - (5分)配置了至少包含如下五个阶段的GitHub Action流水线:初始化Python环境、安装依赖、代码风格检查、运行单元测试、部署API文档。 101 | 102 | ## 提交方式 103 | 104 | Lab 4无需特意提交任何内容,助教会在DDL后检查[OSS-Dev-Course-PKU](https://github.com/OSS-Dev-Course-PKU)中检查相应仓库,做出最终评分。 105 | 106 | ## 参考资料 107 | 108 | 1. [Poetry文档](https://python-poetry.org/docs/) 109 | 2. [pytest文档](https://docs.pytest.org/en/7.1.x/getting-started.html) 110 | 3. [pytest测试里用到的fixture功能](https://docs.pytest.org/en/6.2.x/fixture.html) 111 | 4. [black文档](https://black.readthedocs.io/en/stable/) 112 | 5. [pre-commit文档](https://pre-commit.com/) 113 | 6. [pdoc3文档](https://pdoc3.github.io/pdoc/) 114 | 7. [GitHub Action文档](https://docs.github.com/en/actions),[基本概念](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions),[测试&构建Python项目](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) 115 | 8. 可能有用的GitHub Action插件: 116 | 1. https://black.readthedocs.io/en/stable/integrations/github_actions.html 117 | 2. https://github.com/actions/setup-python 118 | 3. https://github.com/marketplace/actions/deploy-to-github-pages 119 | -------------------------------------------------------------------------------- /Assignments/Lab4/.gitignore: -------------------------------------------------------------------------------- 1 | html/ 2 | 3 | # Byte-compiled / optimized / DLL files 4 | __pycache__/ 5 | *.py[cod] 6 | *$py.class 7 | 8 | # C extensions 9 | *.so 10 | 11 | # Distribution / packaging 12 | .Python 13 | build/ 14 | develop-eggs/ 15 | dist/ 16 | downloads/ 17 | eggs/ 18 | .eggs/ 19 | lib/ 20 | lib64/ 21 | parts/ 22 | sdist/ 23 | var/ 24 | wheels/ 25 | pip-wheel-metadata/ 26 | share/python-wheels/ 27 | *.egg-info/ 28 | .installed.cfg 29 | *.egg 30 | MANIFEST 31 | 32 | # PyInstaller 33 | # Usually these files are written by a python script from a template 34 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 35 | *.manifest 36 | *.spec 37 | 38 | # Installer logs 39 | pip-log.txt 40 | pip-delete-this-directory.txt 41 | 42 | # Unit test / coverage reports 43 | htmlcov/ 44 | .tox/ 45 | .nox/ 46 | .coverage 47 | .coverage.* 48 | .cache 49 | nosetests.xml 50 | coverage.xml 51 | *.cover 52 | *.py,cover 53 | .hypothesis/ 54 | .pytest_cache/ 55 | 56 | # Translations 57 | *.mo 58 | *.pot 59 | 60 | # Django stuff: 61 | *.log 62 | local_settings.py 63 | db.sqlite3 64 | db.sqlite3-journal 65 | 66 | # Flask stuff: 67 | instance/ 68 | .webassets-cache 69 | 70 | # Scrapy stuff: 71 | .scrapy 72 | 73 | # Sphinx documentation 74 | docs/_build/ 75 | 76 | # PyBuilder 77 | target/ 78 | 79 | # Jupyter Notebook 80 | .ipynb_checkpoints 81 | 82 | # IPython 83 | profile_default/ 84 | ipython_config.py 85 | 86 | # pyenv 87 | .python-version 88 | 89 | # pipenv 90 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 91 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 92 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 93 | # install all needed dependencies. 94 | #Pipfile.lock 95 | 96 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 97 | __pypackages__/ 98 | 99 | # Celery stuff 100 | celerybeat-schedule 101 | celerybeat.pid 102 | 103 | # SageMath parsed files 104 | *.sage.py 105 | 106 | # Environments 107 | .env 108 | .venv 109 | env/ 110 | venv/ 111 | ENV/ 112 | env.bak/ 113 | venv.bak/ 114 | 115 | # Spyder project settings 116 | .spyderproject 117 | .spyproject 118 | 119 | # Rope project settings 120 | .ropeproject 121 | 122 | # mkdocs documentation 123 | /site 124 | 125 | # mypy 126 | .mypy_cache/ 127 | .dmypy.json 128 | dmypy.json 129 | 130 | # Pyre type checker 131 | .pyre/ 132 | -------------------------------------------------------------------------------- /Assignments/Lab4/pygraph.py: -------------------------------------------------------------------------------- 1 | from typing import Tuple, Union, Iterable 2 | Node = Union[str, int] 3 | Edge = Tuple[Node, Node] 4 | 5 | 6 | 7 | class Graph(object): 8 | """Graph data structure, undirected by default.""" 9 | def __init__(self, edges: Iterable[Edge] = [], directed: bool = False): 10 | raise NotImplementedError() 11 | 12 | 13 | def has_node(self, node: Node): 14 | """Whether a node is in graph""" 15 | raise NotImplementedError() 16 | def has_edge(self, edge: Edge): 17 | 18 | 19 | 20 | """Whether an edge is in graph""" 21 | raise NotImplementedError() 22 | def add_node(self, node: Node): 23 | """Add a node""" 24 | raise NotImplementedError() 25 | 26 | 27 | def add_edge(self, edge: Edge): 28 | 29 | 30 | """Add an edge (node1, node2). For directed graph, node1 -> node2""" 31 | raise NotImplementedError() 32 | def remove_node(self, node: Node): 33 | """Remove all references to node""" 34 | 35 | 36 | raise NotImplementedError() 37 | def remove_edge(self, edge: Edge): 38 | 39 | 40 | """Remove an edge from graph""" 41 | raise NotImplementedError() 42 | def indegree(self, node: Node) -> int: 43 | """Compute indegree for a node""" 44 | raise NotImplementedError() 45 | def outdegree(self, node: Node) -> int: 46 | 47 | 48 | """Compute outdegree for a node""" 49 | raise NotImplementedError() 50 | 51 | def __str__(self): 52 | raise NotImplementedError() 53 | def __repr__(self): 54 | 55 | 56 | 57 | raise NotImplementedError() 58 | -------------------------------------------------------------------------------- /Assignments/Lab4/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "pygraph" 3 | version = "0.1.0" 4 | description = "Simple Python Graph Library" 5 | authors = [] 6 | 7 | [tool.poetry.dependencies] 8 | python = "^3.10" 9 | 10 | [tool.poetry.dev-dependencies] 11 | pytest = "^6.2" 12 | pytest-cov = "^3.0.0" 13 | black = "*" 14 | pre-commit = "*" 15 | pdoc3 = "0.10.0" 16 | -------------------------------------------------------------------------------- /Assignments/Lab4/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | python_files = pygraph.py tests/*.py 3 | -------------------------------------------------------------------------------- /Assignments/Lab4/tests/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from pygraph import Graph 4 | 5 | 6 | @pytest.fixture(scope="function") 7 | def trivial(): 8 | return Graph([]) 9 | 10 | 11 | @pytest.fixture(scope="function") 12 | def small_directed(): 13 | return Graph([("a", "b"), ("b", "c"), ("b", "d"), ("c", "d")], directed=True) 14 | 15 | 16 | @pytest.fixture(scope="function") 17 | def small_undirected(): 18 | return Graph([("a", "b"), ("b", "c"), ("b", "d"), ("c", "d")], directed=False) 19 | -------------------------------------------------------------------------------- /Assignments/Lab4/tests/test_manipulation.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from pprint import pprint 4 | from pygraph import Graph 5 | 6 | 7 | def test_init_graph(): 8 | graph = Graph(edges=[(1, 2)], directed=True) 9 | assert graph.has_node(1) 10 | assert graph.has_node(2) 11 | assert graph.has_edge((1, 2)) 12 | pprint(graph) 13 | 14 | graph = Graph(edges=[(1, 2)], directed=False) 15 | assert graph.has_node(1) 16 | assert graph.has_node(2) 17 | assert graph.has_edge((1, 2)) 18 | assert graph.has_edge((2, 1)) 19 | pprint(graph) 20 | 21 | 22 | def test_add_node(trivial: Graph): 23 | trivial.add_node(1) 24 | assert trivial.has_node(1) 25 | pprint(trivial) 26 | 27 | 28 | def test_add_edge(trivial: Graph, small_directed: Graph): 29 | trivial.add_edge((1, 2)) 30 | trivial.add_edge((3, 4)) 31 | for i in range(1, 5): 32 | assert trivial.has_node(i) 33 | assert trivial.has_edge((1, 2)) 34 | assert trivial.has_edge((3, 4)) 35 | pprint(trivial) 36 | 37 | small_directed.add_edge(("d", "b")) 38 | assert small_directed.has_edge(("d", "b")) 39 | assert small_directed.has_edge(("b", "d")) 40 | pprint(small_directed) 41 | 42 | 43 | def test_remove_node(trivial: Graph, small_directed: Graph, small_undirected: Graph): 44 | with pytest.raises(ValueError): 45 | trivial.remove_node("a") 46 | 47 | small_directed.remove_node("b") 48 | assert not small_directed.has_node("b") 49 | assert not small_directed.has_edge(("a", "b")) 50 | assert not small_directed.has_edge(("b", "c")) 51 | assert not small_directed.has_edge(("b", "d")) 52 | assert small_directed.has_node("a") 53 | assert small_directed.has_node("c") 54 | assert small_directed.has_node("d") 55 | assert small_directed.has_edge(("c", "d")) 56 | pprint(small_directed) 57 | 58 | small_undirected.remove_node("b") 59 | assert not small_undirected.has_node("b") 60 | assert not small_undirected.has_edge(("a", "b")) 61 | assert not small_undirected.has_edge(("b", "a")) 62 | assert not small_undirected.has_edge(("b", "c")) 63 | assert not small_undirected.has_edge(("c", "b")) 64 | assert not small_undirected.has_edge(("b", "d")) 65 | assert not small_undirected.has_edge(("d", "b")) 66 | assert small_undirected.has_node("a") 67 | assert small_undirected.has_node("c") 68 | assert small_undirected.has_node("d") 69 | assert small_undirected.has_edge(("c", "d")) 70 | assert small_undirected.has_edge(("d", "c")) 71 | pprint(small_undirected) 72 | 73 | 74 | def test_remove_edge(trivial: Graph, small_directed: Graph, small_undirected: Graph): 75 | with pytest.raises(ValueError): 76 | trivial.remove_edge(("a", "b")) 77 | 78 | small_directed.add_edge(("c", "b")) 79 | small_directed.remove_edge(("b", "c")) 80 | assert small_directed.has_node("b") and small_directed.has_node("c") 81 | assert not small_directed.has_edge(("b", "c")) 82 | assert small_directed.has_edge(("c", "b")) 83 | pprint(small_directed) 84 | 85 | small_undirected.remove_edge(("b", "c")) 86 | assert small_undirected.has_node("b") and small_directed.has_node("c") 87 | assert not small_undirected.has_edge(("b", "c")) 88 | assert not small_undirected.has_edge(("c", "b")) 89 | pprint(small_undirected) 90 | -------------------------------------------------------------------------------- /Assignments/Lab4/tests/test_metrics.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pygraph import Graph 3 | 4 | 5 | def test_indegree(small_directed: Graph, small_undirected: Graph): 6 | assert small_undirected.indegree("a") == 1 7 | assert small_undirected.indegree("b") == 3 8 | assert small_undirected.indegree("c") == 2 9 | assert small_undirected.indegree("d") == 2 10 | 11 | with pytest.raises(ValueError): 12 | small_undirected.indegree("e") 13 | 14 | assert small_directed.indegree("a") == 0 15 | assert small_directed.indegree("b") == 1 16 | assert small_directed.indegree("c") == 1 17 | assert small_directed.indegree("d") == 2 18 | 19 | with pytest.raises(ValueError): 20 | small_directed.indegree("e") 21 | 22 | 23 | def test_outdegree(small_directed: Graph, small_undirected: Graph): 24 | assert small_undirected.outdegree("a") == 1 25 | assert small_undirected.outdegree("b") == 3 26 | assert small_undirected.outdegree("c") == 2 27 | assert small_undirected.outdegree("d") == 2 28 | 29 | with pytest.raises(ValueError): 30 | small_undirected.indegree("e") 31 | 32 | assert small_directed.outdegree("a") == 1 33 | assert small_directed.outdegree("b") == 2 34 | assert small_directed.outdegree("c") == 1 35 | assert small_directed.outdegree("d") == 0 36 | 37 | with pytest.raises(ValueError): 38 | small_directed.indegree("e") 39 | -------------------------------------------------------------------------------- /Assignments/Lab5.md: -------------------------------------------------------------------------------- 1 | # Lab 5:Python开源软件包安装/管理/打包/上载(10分) 2 | 3 | **截止日期:2023.12.12 11:59am** 4 | 5 | ## 实践目的 6 | 7 | * 以Python为例,了解对软件项目进行依赖管理、打包、和发布的基本流程 8 | 9 | ## 初始文件 10 | 11 | 请基于你的Lab 4,继续完成本次Lab 12 | 13 | ## 实践流程 14 | 15 | 1. 在`pyproject.toml`中修改`tool.poetry.name`为`pygraph-{姓名拼音}`(例如,`pygraph-zhangsan`),这将是上传到TestPyPI的包名,不能与已有包冲突。 16 | 17 | 2. 在`pyproject.toml`中配置需要打包的文件为`pygraph.py`,这需要用到[tool.poetry.packages](https://python-poetry.org/docs/pyproject/#packages)选项。 18 | 19 | 3. 修改后,使用`poetry update`更新项目配置。 20 | 21 | 4. 使用Poetry打包`pygraph-xxxx`: 22 | 23 | ```shell script 24 | poetry build 25 | ``` 26 | 27 | 上述命令会在`dist/`文件夹中生成wheel文件和源代码tar包,这些是在PyPI上发布所必须的文件。 28 | 29 | 5. 在[TestPyPI](https://test.pypi.org/)注册一个账号,请注意不要在[PyPI](https://pypi.org)上直接注册。 30 | 31 | > [TestPyPI](https://test.pypi.org)是与PyPI分离的Python包发布平台,主要用于学习和测试,不影响真正的Python生态。TestPyPI要求[Two factor authentication (2FA)验证](https://test.pypi.org/help/#twofa),可以使用[Gauth](https://chromewebstore.google.com/detail/gauth-authenticator/ilgcnhelpchnceeipipijaljkblbcobl?hl=zh-CN&utm_source=ext_sidebar)完成验证。 32 | 33 | 6. 在`pyproject.toml`中添加[Twine](https://twine.readthedocs.io/en/stable/)作为开发依赖,并使用`poetry install`安装Twine。 34 | 35 | > [Python官方文档](https://packaging.python.org/en/latest/key_projects/#twine): Twine is the primary tool developers use to upload packages to the Python Package Index or other Python package indexes. It is a command-line program that passes program files and metadata to a web API. Developers use it because it’s the official PyPI upload tool, it’s fast and secure, it’s maintained, and it reliably works. 36 | 37 | 7. 使用Twine在TestPyPI上手动发布`pygraph-xxxx`: 38 | 39 | ```shell script 40 | twine upload --repository testpypi dist/* 41 | ``` 42 | > 注意,PyPi 调整了安全策略,不再允许启用两步验证的账号使用用户名密码来上传项目了,必须使用 API 令牌来进行身份验证。登录 PyPi ,进入账户设置页,点击「添加 API 令牌」按钮创建 API 令牌。然后修改 ~/.pypirc 配置文件, 用户名字段改为__token__ ,密码字段改为刚才创建的令牌,运行上述命令即可完成上传。也可通过-u以及-p传入用户名及密码。 43 | 44 | 此时就可以在TestPyPI上查看你的软件包了(例如[pygraph-zhangsan](https://test.pypi.org/project/pygraph-zhangsan/0.1.0/))。 45 | 46 | 可以尝试退出poetry shell,在一个新的Python环境中运行类似如下命令以安装你的软件包: 47 | 48 | ```shell script 49 | pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pygraph-zhangsan 50 | ``` 51 | 52 | 这里`--extra-index-url`是为了确保pygraph可以安装从PyPI上来的间接依赖。 53 | 54 | 然后,在Python解释器中可以尝试导入pygraph包,类似如下: 55 | 56 | ``` 57 | PS D:\GitHub\OSSDevelopment> pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pygraph-zhangsan 58 | Looking in indexes: https://test.pypi.org/simple/, https://pypi.org/simple/ 59 | Collecting pygraph-zhangsan 60 | Downloading https://test-files.pythonhosted.org/packages/97/fe/0818386b03b062e7d217acbdfc20c5f1bd6cc455c06e07463f5a86da8fc1/pygraph_zhangsan-0.1.0-py3-none-any.whl.metadata (276 bytes) 61 | Downloading https://test-files.pythonhosted.org/packages/97/fe/0818386b03b062e7d217acbdfc20c5f1bd6cc455c06e07463f5a86da8fc1/pygraph_zhangsan-0.1.0-py3-none-any.whl (1.8 kB) 62 | Installing collected packages: pygraph-zhangsan 63 | Successfully installed pygraph-zhangsan-0.1.0 64 | PS D:\GitHub\OSSDevelopment> python 65 | Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32 66 | Type "help", "copyright", "credits" or "license" for more information. 67 | >>> import pygraph 68 | >>> g = pygraph.Graph([(1,2),(3,4)]) 69 | >>> g 70 | Graph({1: {2}, 2: {1}, 3: {4}, 4: {3}}) 71 | ``` 72 | 73 | 但是,像这样在本地手动发布Python包对于团队协作开发的开源项目而言,不是最佳实践。比较好的做法是在GitHub上配置CD流水线,在master分支上达成特定条件(例如使用tag标记的版本)时,自动发布到PyPI。接下来的操作将会达成这一点。 74 | 75 | 8. 借助[networkx](https://networkx.org/documentation/stable/index.html)(可以使用[`poetry add`](https://python-poetry.org/docs/cli/#add)命令添加新依赖),为pygraph实现计算最短路径的功能,并通过测试。在开发完成后,将`pyproject.toml`中的版本号修改为`0.2.0`。 76 | 77 | > 也许这里封装networkx显得很蠢,不过在实际编程中,由于图数据结构无处不在(常常蕴含在其他复杂结构化数据里),经常会有将当前的数据转换格式并应用已有图算法的情况。 78 | 79 | 9. 你的GitHub仓库内[配置TestPyPI的TOKEN为Secret](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)。 80 | 81 | 10. 添加一个新的GitHub Action流水线,使得若你的仓库[在GitHub上创建了一个新release](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release),流水线将会构建、测试、打包pygraph并发布到TestPyPI。 82 | 83 | 11. 将所有更改完成后,push到GitHub,在GitHub上创建一个新的Release,检查自动发布是否生效。 84 | 85 | > 如果配置错误,可修改后重新发布release,测试流水线是否有效 86 | 87 | 12. 可以尝试仿照步骤7,在TestPyPI安装你的包并调用代码,测试发布是否有效。 88 | 89 | ## 评分标准 90 | 91 | - (3分)TestPyPI上有通过步骤1-7发布的Python包。 92 | - (3分)pygraph实现了计算最短路径的功能并包含可通过的测试样例。 93 | - (4分)配置了能够自动发布Python包的GitHub Action流水线。 94 | 95 | ## 提交方式 96 | 97 | Lab 5无需特意提交任何内容,助教会在DDL后检查[OSS-Dev-Course-PKU](https://github.com/OSS-Dev-Course-PKU)中检查相应仓库,以及所对应的TestPyPI包,做出最终评分。 98 | -------------------------------------------------------------------------------- /Assignments/Lab6.md: -------------------------------------------------------------------------------- 1 | # Lab 6:Linux Kernel中的沟通实践(8分) 2 | 3 | **截止日期:2022.11.28 11:59am** 4 | 5 | ## 实践目的 6 | 7 | 通过阅读顶级开源项目的开发文档,结合自己迄今为止的开源开发经验,体会开源开发中沟通与协作的最佳实践。 8 | 9 | ## 实践流程 10 | 11 | **前两个问题二选一回答即可 12 | 13 | > (4分)阅读Linux Kernel中的沟通与协作的实践相关资料(参见末尾),对于下面几个沟通的例子,依次回答:这个例子是否有违反Linux Kernel的沟通最佳实践(即Linux官方文档中定义的沟通要求)?如果有,在这一场景下应该怎么做?为什么需要这么做? 14 | > 15 | > 1. "This limitation should be explained in the cover letter and changelog." (Patch #759033) 16 | > 2. "Commit e21d2170f36602ae2708 (“video: remove unnecessary platform_set_drvdata()”) removed the unnecessary platform_set_drvdata(), but left the variable “dev” unused, delete it." ([Patch #2833310](https://patchwork.kernel.org/project/linux-fbdev/patch/51F0F88D.8060903@cn.fujitsu.com/)) 17 | > 3. "This adds a device tree definition file for LEGO MINDSTORMS EV3." ([Patch #728065](https://patchwork.kernel.org/project/linux-arm-kernel/patch/1484253167-27568-1-git-send-email-david@lechnology.com/)) 18 | > 19 | > 解释的时候请一并附上Linux官方文档中的有关内容(关于沟通的要求)。 20 | 21 | (在这里写下你的回答) 22 | 23 | > (4分)选择一个你感兴趣的开源项目,选择三个沟通的例子,依次对每个例子回答: 24 | 这个例子是否违反了这个项目(文档定义的)沟通最佳实践,或者一般意义上的开源项目沟通最佳实践?如果有,在这一场景下应该怎么做?为什么需要这么做? 25 | 或者,这个例子是否有你认为做的很好的地方?如果有,为什么? 26 | 请一并列出你的回答涉及的例子的链接。 27 | 28 | (在这里写下你的回答) 29 | 30 | > (4分)你迄今为止与开源社区做的沟通交流中,有哪些做的符合你认为的最佳实践的地方?有哪些做的不太合适,可以改进的地方?请提供你的沟通交流的相关链接,结合实际例子总结。 31 | 32 | (在这里写下你的回答) 33 | 34 | ## 提交方式 35 | 36 | 请在截止日期之前,将此markdown文件(请检查前面的问题是不是已经都回答了)发送到助教邮箱(xuww@stu.pku.edu.cn),文件命名统一为`学号-姓名-Lab6.md`。 37 | 38 | ## 评分标准 39 | 40 | 对实践流程中提出的所有问题,均有合理的回答即得满分,否则酌情扣分。 41 | 42 | 提交超出截止日期24小时内,最多获得80%的分数;提交超出截止日期72小时内,最多获得50%的分数;超出截止日期72小时的提交不得分。 43 | 44 | ## 参考资料 45 | 46 | * https://www.kernel.org/doc/html/latest/process/howto.html 47 | * https://www.kernel.org/doc/html/latest/process/management-style.html#managementstyle 48 | * https://www.kernel.org/doc/html/latest/process/submitting-patches.html#submittingpatches 49 | * https://www.kernel.org/doc/html/latest/process/development-process.html 50 | * Tan, Xin, and Minghui Zhou. "How to communicate when submitting patches: An empirical study of the Linux kernel." Proceedings of the ACM on Human-Computer Interaction 3.CSCW (2019): 1-26. https://dl.acm.org/doi/abs/10.1145/3359210 51 | -------------------------------------------------------------------------------- /Assignments/Project.md: -------------------------------------------------------------------------------- 1 | # 课程项目:为真正的开源项目做贡献! 2 | 3 | ## 目标 4 | 5 | 课程项目的首要目标是希望同学能够通过一学期的课程学习和实践,能够初步理解开源项目的运转、开发和组织模式,以便将来在需要的时候,能够加入开源项目,对开源项目做出自己的贡献,或者开始自己的开源项目。 6 | 7 | ## 主要任务 8 | 9 | 课程项目的主要任务是**对一个或多个具有一定质量水准的开源项目,做出自己的贡献**。于此同时,我们安排了三次presentation和一次期末报告,作为我们考核**开源贡献的质量**的重要参考。 10 | 11 | 需要注意的是,贡献的项目必须是具有一定质量水准的开源项目(有证据能证明高质量、被很多人使用、贡献者多,等等);自己建一个GitHub仓库,但是不满足上述质量水准,是不可以的。 12 | 13 | 由于开源贡献过程的挑战性和不确定性,我们强烈建议在课程学习的过程中,尽早开始,并且对多个开源项目尝试做贡献。不管贡献最终是否被接收,都会纳入最终的考核标准中,还请多多尝试。 14 | 15 | ## 检查清单 16 | 17 | ### 项目选择 18 | 19 | * 是否选择了活跃、有关注度的开源项目? 20 | * 是否能够配置好项目需要的开发环境? 21 | * 是否对这个项目有强烈的兴趣? 22 | * 是否对这个项目的相关领域、编程语言、技术栈比较熟悉? 23 | * 这个项目是否有完善的开源管理机制? 24 | 25 | ### 任务选择 26 | 27 | * 这个项目是否有比较多的待解决issue? 28 | * 这个项目是否有比较多的good first issue? 29 | * 有没有自己作为项目的用户想要去解决的问题? 30 | * 这个项目对issue的管理机制如何? 31 | * 这个项目的贡献流程和要求如何? 32 | 33 | ## 参考资料 34 | 35 | 1. [https://opensource.guide/](https://opensource.guide/): 关于如何参与开源的各种指南 36 | 2. [https://github.blog/2020-01-22-browse-good-first-issues-to-start-contributing-to-open-source/](https://github.blog/2020-01-22-browse-good-first-issues-to-start-contributing-to-open-source/): GitHub官方对good first issue功能的介绍 37 | 3. [https://github.com/topics/good-first-issue](https://github.com/topics/good-first-issue): GitHub提供的good first issue主题页面 38 | 4. [https://goodfirstissue.dev/](https://goodfirstissue.dev/): 一个列出有good first issue的GitHub项目的网站 39 | 5. [https://gfibot.io/](https://gfibot.io/): 对一些GitHub项目推荐good first issue(来自我们实验室) 40 | 41 | ## 考核方式及评分标准 42 | 43 | ### 开题/中期/期末Presentation(每个5分,共15分) 44 | 45 | 为了跟踪进展和提供反馈,课程会安排三次presentation(开题/中期/期末,时间参见[课程大纲](../Syllabus.md)),每次presentation的内容要求如下(对PPT模板和形式不做要求): 46 | 47 | #### 开题Presentation 48 | 49 | 1. 计划贡献的开源项目及其基本情况 50 | 2. 为什么选择这个/这些开源项目?这个/这些项目的哪些方面吸引到了你?你对这个/这些项目的了解情况如何? 51 | 3. 计划去做什么任务/解决什么issue? 52 | 53 | #### 中期Presentation 54 | 55 | 1. 选择的开源项目/任务 56 | 2. 已进行的开发和交流活动 57 | 3. 过程中遇到的事件、问题和收获 58 | 4. 未来的计划 59 | 60 | #### 期末Presentation 61 | 62 | 1. 选择的开源项目/任务 63 | 2. 每一个贡献从提出到被接收/拒绝的过程,涉及的沟通过程和代码贡献 64 | 3. 对开源参与的总结/思考 65 | 4. 对课程的建议 66 | 67 | 对于每次presentation,能够按照要求作报告,且报告中包含了要求的所有内容,即得5分满分。如果存在内容欠缺,明显准备不充分的情况,酌情扣分。 68 | 69 | 请在presentation开始前,将ppt以邮件形式发送给助教(xuww@stu.pku.edu.cn),文件命名统一为`学号-姓名-开题/中期/期末Pre.pdf/pptx`。 70 | 71 | ### 期末报告(10分) 72 | 73 | 在期末presentation结束后,要求提交一个期末报告,作为整个开源参与过程和思考的一个正式记录,也是我们评分的重要参考之一。 74 | 75 | 报告要求使用LaTeX撰写,模板参见[Report/](Report/)文件夹,以PDF格式提交,详细要求参见报告模板。可以将报告模版文件上传到[OverLeaf](https://www.overleaf.com/)上,设置编译器为XeLaTeX即可一键编译为PDF,避免复杂的LaTeX环境配置。 76 | 77 | 如果合适,可以直接复用你的Lab和Presentation的相关内容用于撰写期末报告。不过,需要注意报告作为一个整体的逻辑完整性和一致性。 78 | 79 | 最终提交的报告评分分配如下: 80 | * 遵循要求的报告格式,1分; 81 | * “开源项目概览”小节,3分; 82 | * “对开源项目的贡献”小节,3分; 83 | * “总结与反思”小节,3分。 84 | 85 | 每一小节的评分将根据报告的表达清晰度、思考深度、认真程度等因素综合评判,会根据优秀率的情况进行适当调整。需要特别注意的是,**报告的长度不会成为评分的标准**,希望大家把功课主要放在做开源贡献本身,及对整个过程的总结和思考上,报告简明扼要,能够表达清楚意思即可。 86 | 87 | 请在截止日期之前(具体时间参见今年的[课程大纲](../Syllabus.md)),将期末报告的PDF以邮件形式发送给助教(xuww@stu.pku.edu.cn),文件命名统一为`学号-姓名-期末报告.pdf`。 88 | 89 | ### 贡献质量(15分) 90 | 91 | 评分分配:基本分(5分) + 工作量加分(5分) + 难度加分(5分) 92 | 93 | 1. 基本分(5分)的评分标准如下: 94 | - 与一个开源项目进行了某种程度的合理交互(开启issue、参与issue讨论等),获得1分。 95 | - 向一个开源项目提交了一个贡献,获得2分。 96 | - 这个贡献最终被社区接受,获得1分。 97 | - 如果是**涉及源代码变更**的贡献,获得1分(毕竟本课程名为《开源**软件**技术》:);是否涉及源代码变更,以助教判定为准)。 98 | - 如果在做出贡献的过程中出现明显违背[GitHub Code of Conduct](https://docs.github.com/en/site-policy/github-terms/github-community-code-of-conduct)的行为,视情况扣分 99 | 2. 工作量加分(5分)采用积分制,5分封顶: 100 | - (代码工作量加分)以下项目中,选择最高的加分项目: 101 | * 如果有一个被接收的贡献,代码变更行数大于20行,加1分; 102 | * 如果有一个被接收的贡献,代码变更行数大于100行,加2分; 103 | * 如果有一个被接收的贡献,代码变更行数大于500行,加3分。 104 | * **备注:** 代码变更行数为添加行数和删除行数之和;如果代码变更都是高度重复或没有技术含量的变更(例如,重新格式化代码),助教保留取消这部分加分的权力。 105 | - (沟通工作量加分)如果存在一个贡献,经过反复沟通,或者被社区多轮打回修改才最终被接收,加1分;至多有三个贡献可以通过此条规则获得加分(亦即沟通工作量加分最多为3分) 106 | - (贡献数量/类型加分)以下项目中,选择最高的加分项目: 107 | * 如果被接收的贡献数量大于等于3个,加1分。 108 | * 如果被接收的贡献覆盖了N种不同的贡献类型,加N分(最多通过此条规则加3分)。 109 | * **备注:** 贡献类型包括修复Bug、实现新功能、优化性能、重构代码、编写文档、编写测试、协助构建/部署,等等;一般以开源项目的Issue Label为判定标准,对于模糊的情况,助教保留最终判定的权力。 110 | - 对于没有最终被社区接收的贡献,在表现出合理的交互、沟通、和努力的前提下,可以按上述标准的60%获得加分。 111 | 3. 难度加分(5分)将由助教考虑所有学生的情况进行综合评判,如果工作量加分的标准难以衡量实际的工作量和难度(例如向知名、复杂、开发难度高的项目进行贡献等),会适当在给分上予以倾斜,同时整体根据优秀率的情况进行适当调整。 112 | 113 | -------------------------------------------------------------------------------- /Assignments/README.md: -------------------------------------------------------------------------------- 1 | # Assignments // 课程作业 2 | 3 | ## 实践作业(Labs) 4 | 5 | **主要目的:** 熟悉开源软件项目的开发方式和常见最佳实践 6 | 7 | 1. [Lab 1](Lab1.md):熟悉git和GitHub(7分) 8 | 2. [Lab 2](Lab2.md):了解开源项目的开发方式和贡献流程(7分) 9 | 3. [Lab 3](Lab3.md):在开源项目中选择开发任务(8分) 10 | 4. [Lab 4](Lab4.md):CI/CD流水线搭建(10分) 11 | 5. [Lab 5](Lab5.md):Python开源软件包安装/管理/打包/上载(10分) 12 | 6. [Lab 6](Lab6.md):Linux Kernel中的沟通实践(8分) 13 | 14 | Labs占期末总评的50分 15 | 16 | ## 课程项目(Project) 17 | 18 | **主要目的:** 在实际的开源项目中与开发者沟通、做出贡献,并总结反思整个过程 19 | 20 | 1. [Project.md](Project.md):详细要求及评分标准 21 | 2. [Report/](Report/):报告模板 22 | 23 | Project占期末总评的40分 24 | 25 | ## Lab的待改进点(源自同学反馈) 26 | 27 | 1. 更多的git和GitHub实践练习(例如,如何给PR追加修改,如何解决合并冲突) 28 | -------------------------------------------------------------------------------- /Assignments/Report/.gitignore: -------------------------------------------------------------------------------- 1 | ## Core latex/pdflatex auxiliary files: 2 | *.aux 3 | *.lof 4 | *.log 5 | *.lot 6 | *.fls 7 | *.out 8 | *.toc 9 | *.fmt 10 | *.fot 11 | *.cb 12 | *.cb2 13 | .*.lb 14 | delete-temp-files.bat 15 | elegantpaper-cn.pdf 16 | elegantpaper-en.pdf 17 | *clean.bat 18 | 19 | ## Intermediate documents: 20 | *.dvi 21 | *.xdv 22 | *-converted-to.* 23 | # these rules might exclude image files for figures etc. 24 | # *.ps 25 | # *.eps 26 | # *.pdf 27 | 28 | ## Generated if empty string is given at "Please type another file name for output:" 29 | .pdf 30 | 31 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 32 | *.bbl 33 | *.bcf 34 | *.blg 35 | *-blx.aux 36 | *-blx.bib 37 | *.run.xml 38 | 39 | ## Build tool auxiliary files: 40 | *.fdb_latexmk 41 | *.synctex 42 | *.synctex(busy) 43 | *.synctex.gz 44 | *.synctex.gz(busy) 45 | *.pdfsync 46 | 47 | ## Auxiliary and intermediate files from other packages: 48 | # algorithms 49 | *.alg 50 | *.loa 51 | 52 | # achemso 53 | acs-*.bib 54 | 55 | # amsthm 56 | *.thm 57 | 58 | # beamer 59 | *.nav 60 | *.pre 61 | *.snm 62 | *.vrb 63 | 64 | # changes 65 | *.soc 66 | 67 | # cprotect 68 | *.cpt 69 | 70 | # elsarticle (documentclass of Elsevier journals) 71 | *.spl 72 | 73 | # endnotes 74 | *.ent 75 | 76 | # fixme 77 | *.lox 78 | 79 | # feynmf/feynmp 80 | *.mf 81 | *.mp 82 | *.t[1-9] 83 | *.t[1-9][0-9] 84 | *.tfm 85 | 86 | #(r)(e)ledmac/(r)(e)ledpar 87 | *.end 88 | *.?end 89 | *.[1-9] 90 | *.[1-9][0-9] 91 | *.[1-9][0-9][0-9] 92 | *.[1-9]R 93 | *.[1-9][0-9]R 94 | *.[1-9][0-9][0-9]R 95 | *.eledsec[1-9] 96 | *.eledsec[1-9]R 97 | *.eledsec[1-9][0-9] 98 | *.eledsec[1-9][0-9]R 99 | *.eledsec[1-9][0-9][0-9] 100 | *.eledsec[1-9][0-9][0-9]R 101 | 102 | # glossaries 103 | *.acn 104 | *.acr 105 | *.glg 106 | *.glo 107 | *.gls 108 | *.glsdefs 109 | 110 | # gnuplottex 111 | *-gnuplottex-* 112 | 113 | # gregoriotex 114 | *.gaux 115 | *.gtex 116 | 117 | # htlatex 118 | *.4ct 119 | *.4tc 120 | *.idv 121 | *.lg 122 | *.trc 123 | *.xref 124 | 125 | # hyperref 126 | *.brf 127 | 128 | # knitr 129 | *-concordance.tex 130 | # TODO Comment the next line if you want to keep your tikz graphics files 131 | *.tikz 132 | *-tikzDictionary 133 | 134 | # listings 135 | *.lol 136 | 137 | # makeidx 138 | *.idx 139 | *.ilg 140 | *.ind 141 | *.ist 142 | 143 | # minitoc 144 | *.maf 145 | *.mlf 146 | *.mlt 147 | *.mtc[0-9]* 148 | *.slf[0-9]* 149 | *.slt[0-9]* 150 | *.stc[0-9]* 151 | 152 | # minted 153 | _minted* 154 | *.pyg 155 | 156 | # morewrites 157 | *.mw 158 | 159 | # nomencl 160 | *.nlg 161 | *.nlo 162 | *.nls 163 | 164 | # pax 165 | *.pax 166 | 167 | # pdfpcnotes 168 | *.pdfpc 169 | 170 | # sagetex 171 | *.sagetex.sage 172 | *.sagetex.py 173 | *.sagetex.scmd 174 | 175 | # scrwfile 176 | *.wrt 177 | 178 | # sympy 179 | *.sout 180 | *.sympy 181 | sympy-plots-for-*.tex/ 182 | 183 | # pdfcomment 184 | *.upa 185 | *.upb 186 | 187 | # pythontex 188 | *.pytxcode 189 | pythontex-files-*/ 190 | 191 | # thmtools 192 | *.loe 193 | 194 | # TikZ & PGF 195 | *.dpth 196 | *.md5 197 | *.auxlock 198 | 199 | # todonotes 200 | *.tdo 201 | 202 | # easy-todo 203 | *.lod 204 | 205 | # xmpincl 206 | *.xmpi 207 | 208 | # xindy 209 | *.xdy 210 | 211 | # xypic precompiled matrices 212 | *.xyc 213 | 214 | # endfloat 215 | *.ttt 216 | *.fff 217 | 218 | # Latexian 219 | TSWLatexianTemp* 220 | 221 | ## Editors: 222 | # WinEdt 223 | *.bak 224 | *.sav 225 | 226 | # Texpad 227 | .texpadtmp 228 | 229 | # Kile 230 | *.backup 231 | 232 | # KBibTeX 233 | *~[0-9]* 234 | 235 | # auto folder when using emacs and auctex 236 | ./auto/* 237 | *.el 238 | 239 | # expex forward references with \gathertags 240 | *-tags.tex 241 | 242 | # standalone packages 243 | *.sta 244 | 245 | # generated if using elsarticle.cls 246 | *.spl 247 | -------------------------------------------------------------------------------- /Assignments/Report/LICENSE: -------------------------------------------------------------------------------- 1 | The LaTeX Project Public License 2 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 3 | 4 | LPPL Version 1.3c 2008-05-04 5 | 6 | Copyright 1999 2002-2008 LaTeX3 Project 7 | Everyone is allowed to distribute verbatim copies of this 8 | license document, but modification of it is not allowed. 9 | 10 | 11 | PREAMBLE 12 | ======== 13 | 14 | The LaTeX Project Public License (LPPL) is the primary license under 15 | which the LaTeX kernel and the base LaTeX packages are distributed. 16 | 17 | You may use this license for any work of which you hold the copyright 18 | and which you wish to distribute. This license may be particularly 19 | suitable if your work is TeX-related (such as a LaTeX package), but 20 | it is written in such a way that you can use it even if your work is 21 | unrelated to TeX. 22 | 23 | The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', 24 | below, gives instructions, examples, and recommendations for authors 25 | who are considering distributing their works under this license. 26 | 27 | This license gives conditions under which a work may be distributed 28 | and modified, as well as conditions under which modified versions of 29 | that work may be distributed. 30 | 31 | We, the LaTeX3 Project, believe that the conditions below give you 32 | the freedom to make and distribute modified versions of your work 33 | that conform with whatever technical specifications you wish while 34 | maintaining the availability, integrity, and reliability of 35 | that work. If you do not see how to achieve your goal while 36 | meeting these conditions, then read the document `cfgguide.tex' 37 | and `modguide.tex' in the base LaTeX distribution for suggestions. 38 | 39 | 40 | DEFINITIONS 41 | =========== 42 | 43 | In this license document the following terms are used: 44 | 45 | `Work' 46 | Any work being distributed under this License. 47 | 48 | `Derived Work' 49 | Any work that under any applicable law is derived from the Work. 50 | 51 | `Modification' 52 | Any procedure that produces a Derived Work under any applicable 53 | law -- for example, the production of a file containing an 54 | original file associated with the Work or a significant portion of 55 | such a file, either verbatim or with modifications and/or 56 | translated into another language. 57 | 58 | `Modify' 59 | To apply any procedure that produces a Derived Work under any 60 | applicable law. 61 | 62 | `Distribution' 63 | Making copies of the Work available from one person to another, in 64 | whole or in part. Distribution includes (but is not limited to) 65 | making any electronic components of the Work accessible by 66 | file transfer protocols such as FTP or HTTP or by shared file 67 | systems such as Sun's Network File System (NFS). 68 | 69 | `Compiled Work' 70 | A version of the Work that has been processed into a form where it 71 | is directly usable on a computer system. This processing may 72 | include using installation facilities provided by the Work, 73 | transformations of the Work, copying of components of the Work, or 74 | other activities. Note that modification of any installation 75 | facilities provided by the Work constitutes modification of the Work. 76 | 77 | `Current Maintainer' 78 | A person or persons nominated as such within the Work. If there is 79 | no such explicit nomination then it is the `Copyright Holder' under 80 | any applicable law. 81 | 82 | `Base Interpreter' 83 | A program or process that is normally needed for running or 84 | interpreting a part or the whole of the Work. 85 | 86 | A Base Interpreter may depend on external components but these 87 | are not considered part of the Base Interpreter provided that each 88 | external component clearly identifies itself whenever it is used 89 | interactively. Unless explicitly specified when applying the 90 | license to the Work, the only applicable Base Interpreter is a 91 | `LaTeX-Format' or in the case of files belonging to the 92 | `LaTeX-format' a program implementing the `TeX language'. 93 | 94 | 95 | 96 | CONDITIONS ON DISTRIBUTION AND MODIFICATION 97 | =========================================== 98 | 99 | 1. Activities other than distribution and/or modification of the Work 100 | are not covered by this license; they are outside its scope. In 101 | particular, the act of running the Work is not restricted and no 102 | requirements are made concerning any offers of support for the Work. 103 | 104 | 2. You may distribute a complete, unmodified copy of the Work as you 105 | received it. Distribution of only part of the Work is considered 106 | modification of the Work, and no right to distribute such a Derived 107 | Work may be assumed under the terms of this clause. 108 | 109 | 3. You may distribute a Compiled Work that has been generated from a 110 | complete, unmodified copy of the Work as distributed under Clause 2 111 | above, as long as that Compiled Work is distributed in such a way that 112 | the recipients may install the Compiled Work on their system exactly 113 | as it would have been installed if they generated a Compiled Work 114 | directly from the Work. 115 | 116 | 4. If you are the Current Maintainer of the Work, you may, without 117 | restriction, modify the Work, thus creating a Derived Work. You may 118 | also distribute the Derived Work without restriction, including 119 | Compiled Works generated from the Derived Work. Derived Works 120 | distributed in this manner by the Current Maintainer are considered to 121 | be updated versions of the Work. 122 | 123 | 5. If you are not the Current Maintainer of the Work, you may modify 124 | your copy of the Work, thus creating a Derived Work based on the Work, 125 | and compile this Derived Work, thus creating a Compiled Work based on 126 | the Derived Work. 127 | 128 | 6. If you are not the Current Maintainer of the Work, you may 129 | distribute a Derived Work provided the following conditions are met 130 | for every component of the Work unless that component clearly states 131 | in the copyright notice that it is exempt from that condition. Only 132 | the Current Maintainer is allowed to add such statements of exemption 133 | to a component of the Work. 134 | 135 | a. If a component of this Derived Work can be a direct replacement 136 | for a component of the Work when that component is used with the 137 | Base Interpreter, then, wherever this component of the Work 138 | identifies itself to the user when used interactively with that 139 | Base Interpreter, the replacement component of this Derived Work 140 | clearly and unambiguously identifies itself as a modified version 141 | of this component to the user when used interactively with that 142 | Base Interpreter. 143 | 144 | b. Every component of the Derived Work contains prominent notices 145 | detailing the nature of the changes to that component, or a 146 | prominent reference to another file that is distributed as part 147 | of the Derived Work and that contains a complete and accurate log 148 | of the changes. 149 | 150 | c. No information in the Derived Work implies that any persons, 151 | including (but not limited to) the authors of the original version 152 | of the Work, provide any support, including (but not limited to) 153 | the reporting and handling of errors, to recipients of the 154 | Derived Work unless those persons have stated explicitly that 155 | they do provide such support for the Derived Work. 156 | 157 | d. You distribute at least one of the following with the Derived Work: 158 | 159 | 1. A complete, unmodified copy of the Work; 160 | if your distribution of a modified component is made by 161 | offering access to copy the modified component from a 162 | designated place, then offering equivalent access to copy 163 | the Work from the same or some similar place meets this 164 | condition, even though third parties are not compelled to 165 | copy the Work along with the modified component; 166 | 167 | 2. Information that is sufficient to obtain a complete, 168 | unmodified copy of the Work. 169 | 170 | 7. If you are not the Current Maintainer of the Work, you may 171 | distribute a Compiled Work generated from a Derived Work, as long as 172 | the Derived Work is distributed to all recipients of the Compiled 173 | Work, and as long as the conditions of Clause 6, above, are met with 174 | regard to the Derived Work. 175 | 176 | 8. The conditions above are not intended to prohibit, and hence do not 177 | apply to, the modification, by any method, of any component so that it 178 | becomes identical to an updated version of that component of the Work as 179 | it is distributed by the Current Maintainer under Clause 4, above. 180 | 181 | 9. Distribution of the Work or any Derived Work in an alternative 182 | format, where the Work or that Derived Work (in whole or in part) is 183 | then produced by applying some process to that format, does not relax or 184 | nullify any sections of this license as they pertain to the results of 185 | applying that process. 186 | 187 | 10. a. A Derived Work may be distributed under a different license 188 | provided that license itself honors the conditions listed in 189 | Clause 6 above, in regard to the Work, though it does not have 190 | to honor the rest of the conditions in this license. 191 | 192 | b. If a Derived Work is distributed under a different license, that 193 | Derived Work must provide sufficient documentation as part of 194 | itself to allow each recipient of that Derived Work to honor the 195 | restrictions in Clause 6 above, concerning changes from the Work. 196 | 197 | 11. This license places no restrictions on works that are unrelated to 198 | the Work, nor does this license place any restrictions on aggregating 199 | such works with the Work by any means. 200 | 201 | 12. Nothing in this license is intended to, or may be used to, prevent 202 | complete compliance by all parties with all applicable laws. 203 | 204 | 205 | NO WARRANTY 206 | =========== 207 | 208 | There is no warranty for the Work. Except when otherwise stated in 209 | writing, the Copyright Holder provides the Work `as is', without 210 | warranty of any kind, either expressed or implied, including, but not 211 | limited to, the implied warranties of merchantability and fitness for a 212 | particular purpose. The entire risk as to the quality and performance 213 | of the Work is with you. Should the Work prove defective, you assume 214 | the cost of all necessary servicing, repair, or correction. 215 | 216 | In no event unless required by applicable law or agreed to in writing 217 | will The Copyright Holder, or any author named in the components of the 218 | Work, or any other party who may distribute and/or modify the Work as 219 | permitted above, be liable to you for damages, including any general, 220 | special, incidental or consequential damages arising out of any use of 221 | the Work or out of inability to use the Work (including, but not limited 222 | to, loss of data, data being rendered inaccurate, or losses sustained by 223 | anyone as a result of any failure of the Work to operate with any other 224 | programs), even if the Copyright Holder or said author or said other 225 | party has been advised of the possibility of such damages. 226 | 227 | 228 | MAINTENANCE OF THE WORK 229 | ======================= 230 | 231 | The Work has the status `author-maintained' if the Copyright Holder 232 | explicitly and prominently states near the primary copyright notice in 233 | the Work that the Work can only be maintained by the Copyright Holder 234 | or simply that it is `author-maintained'. 235 | 236 | The Work has the status `maintained' if there is a Current Maintainer 237 | who has indicated in the Work that they are willing to receive error 238 | reports for the Work (for example, by supplying a valid e-mail 239 | address). It is not required for the Current Maintainer to acknowledge 240 | or act upon these error reports. 241 | 242 | The Work changes from status `maintained' to `unmaintained' if there 243 | is no Current Maintainer, or the person stated to be Current 244 | Maintainer of the work cannot be reached through the indicated means 245 | of communication for a period of six months, and there are no other 246 | significant signs of active maintenance. 247 | 248 | You can become the Current Maintainer of the Work by agreement with 249 | any existing Current Maintainer to take over this role. 250 | 251 | If the Work is unmaintained, you can become the Current Maintainer of 252 | the Work through the following steps: 253 | 254 | 1. Make a reasonable attempt to trace the Current Maintainer (and 255 | the Copyright Holder, if the two differ) through the means of 256 | an Internet or similar search. 257 | 258 | 2. If this search is successful, then enquire whether the Work 259 | is still maintained. 260 | 261 | a. If it is being maintained, then ask the Current Maintainer 262 | to update their communication data within one month. 263 | 264 | b. If the search is unsuccessful or no action to resume active 265 | maintenance is taken by the Current Maintainer, then announce 266 | within the pertinent community your intention to take over 267 | maintenance. (If the Work is a LaTeX work, this could be 268 | done, for example, by posting to comp.text.tex.) 269 | 270 | 3a. If the Current Maintainer is reachable and agrees to pass 271 | maintenance of the Work to you, then this takes effect 272 | immediately upon announcement. 273 | 274 | b. If the Current Maintainer is not reachable and the Copyright 275 | Holder agrees that maintenance of the Work be passed to you, 276 | then this takes effect immediately upon announcement. 277 | 278 | 4. If you make an `intention announcement' as described in 2b. above 279 | and after three months your intention is challenged neither by 280 | the Current Maintainer nor by the Copyright Holder nor by other 281 | people, then you may arrange for the Work to be changed so as 282 | to name you as the (new) Current Maintainer. 283 | 284 | 5. If the previously unreachable Current Maintainer becomes 285 | reachable once more within three months of a change completed 286 | under the terms of 3b) or 4), then that Current Maintainer must 287 | become or remain the Current Maintainer upon request provided 288 | they then update their communication data within one month. 289 | 290 | A change in the Current Maintainer does not, of itself, alter the fact 291 | that the Work is distributed under the LPPL license. 292 | 293 | If you become the Current Maintainer of the Work, you should 294 | immediately provide, within the Work, a prominent and unambiguous 295 | statement of your status as Current Maintainer. You should also 296 | announce your new status to the same pertinent community as 297 | in 2b) above. 298 | 299 | 300 | WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE 301 | ====================================================== 302 | 303 | This section contains important instructions, examples, and 304 | recommendations for authors who are considering distributing their 305 | works under this license. These authors are addressed as `you' in 306 | this section. 307 | 308 | Choosing This License or Another License 309 | ---------------------------------------- 310 | 311 | If for any part of your work you want or need to use *distribution* 312 | conditions that differ significantly from those in this license, then 313 | do not refer to this license anywhere in your work but, instead, 314 | distribute your work under a different license. You may use the text 315 | of this license as a model for your own license, but your license 316 | should not refer to the LPPL or otherwise give the impression that 317 | your work is distributed under the LPPL. 318 | 319 | The document `modguide.tex' in the base LaTeX distribution explains 320 | the motivation behind the conditions of this license. It explains, 321 | for example, why distributing LaTeX under the GNU General Public 322 | License (GPL) was considered inappropriate. Even if your work is 323 | unrelated to LaTeX, the discussion in `modguide.tex' may still be 324 | relevant, and authors intending to distribute their works under any 325 | license are encouraged to read it. 326 | 327 | A Recommendation on Modification Without Distribution 328 | ----------------------------------------------------- 329 | 330 | It is wise never to modify a component of the Work, even for your own 331 | personal use, without also meeting the above conditions for 332 | distributing the modified component. While you might intend that such 333 | modifications will never be distributed, often this will happen by 334 | accident -- you may forget that you have modified that component; or 335 | it may not occur to you when allowing others to access the modified 336 | version that you are thus distributing it and violating the conditions 337 | of this license in ways that could have legal implications and, worse, 338 | cause problems for the community. It is therefore usually in your 339 | best interest to keep your copy of the Work identical with the public 340 | one. Many works provide ways to control the behavior of that work 341 | without altering any of its licensed components. 342 | 343 | How to Use This License 344 | ----------------------- 345 | 346 | To use this license, place in each of the components of your work both 347 | an explicit copyright notice including your name and the year the work 348 | was authored and/or last substantially modified. Include also a 349 | statement that the distribution and/or modification of that 350 | component is constrained by the conditions in this license. 351 | 352 | Here is an example of such a notice and statement: 353 | 354 | %% pig.dtx 355 | %% Copyright 2005 M. Y. Name 356 | % 357 | % This work may be distributed and/or modified under the 358 | % conditions of the LaTeX Project Public License, either version 1.3 359 | % of this license or (at your option) any later version. 360 | % The latest version of this license is in 361 | % http://www.latex-project.org/lppl.txt 362 | % and version 1.3 or later is part of all distributions of LaTeX 363 | % version 2005/12/01 or later. 364 | % 365 | % This work has the LPPL maintenance status `maintained'. 366 | % 367 | % The Current Maintainer of this work is M. Y. Name. 368 | % 369 | % This work consists of the files pig.dtx and pig.ins 370 | % and the derived file pig.sty. 371 | 372 | Given such a notice and statement in a file, the conditions 373 | given in this license document would apply, with the `Work' referring 374 | to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being 375 | generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' 376 | referring to any `LaTeX-Format', and both `Copyright Holder' and 377 | `Current Maintainer' referring to the person `M. Y. Name'. 378 | 379 | If you do not want the Maintenance section of LPPL to apply to your 380 | Work, change `maintained' above into `author-maintained'. 381 | However, we recommend that you use `maintained', as the Maintenance 382 | section was added in order to ensure that your Work remains useful to 383 | the community even when you can no longer maintain and support it 384 | yourself. 385 | 386 | Derived Works That Are Not Replacements 387 | --------------------------------------- 388 | 389 | Several clauses of the LPPL specify means to provide reliability and 390 | stability for the user community. They therefore concern themselves 391 | with the case that a Derived Work is intended to be used as a 392 | (compatible or incompatible) replacement of the original Work. If 393 | this is not the case (e.g., if a few lines of code are reused for a 394 | completely different task), then clauses 6b and 6d shall not apply. 395 | 396 | 397 | Important Recommendations 398 | ------------------------- 399 | 400 | Defining What Constitutes the Work 401 | 402 | The LPPL requires that distributions of the Work contain all the 403 | files of the Work. It is therefore important that you provide a 404 | way for the licensee to determine which files constitute the Work. 405 | This could, for example, be achieved by explicitly listing all the 406 | files of the Work near the copyright notice of each file or by 407 | using a line such as: 408 | 409 | % This work consists of all files listed in manifest.txt. 410 | 411 | in that place. In the absence of an unequivocal list it might be 412 | impossible for the licensee to determine what is considered by you 413 | to comprise the Work and, in such a case, the licensee would be 414 | entitled to make reasonable conjectures as to which files comprise 415 | the Work. 416 | 417 | -------------------------------------------------------------------------------- /Assignments/Report/elegantpaper.cls: -------------------------------------------------------------------------------- 1 | % Author: Dongsheng Deng 2 | % Homepage: https://ddswhu.me/ 3 | % Email: elegantlatex2e@gmail.com 4 | % Lastest Version: https://github.com/ElegantLaTeX/ElegantPaper 5 | 6 | % --- Class structure: identification part 7 | \ProvidesClass{elegantpaper}[2020/04/12 v0.09 ElegantLaTeX Paper class] 8 | \NeedsTeXFormat{LaTeX2e} 9 | 10 | \RequirePackage{kvoptions} 11 | \RequirePackage{etoolbox} 12 | \RequirePackage{calc} 13 | 14 | \SetupKeyvalOptions{family=ELEGANT, prefix=ELEGANT@, setkeys=\kvsetkeys} 15 | \newcommand{\ekv}[1]{\kvsetkeys{ELEGANT}{#1}} 16 | 17 | \DeclareStringOption[en]{lang} 18 | \DeclareVoidOption{cn}{\ekv{lang=cn}} 19 | \DeclareVoidOption{en}{\ekv{lang=en}} 20 | 21 | \DeclareStringOption[cm]{math} 22 | 23 | \DeclareStringOption[numbers]{cite} 24 | \DeclareVoidOption{numbers}{\ekv{cite=numbers}} 25 | \DeclareVoidOption{authoryear}{\ekv{cite=authoryear}} 26 | \DeclareVoidOption{super}{\ekv{cite=super}} 27 | 28 | \DeclareStringOption[apalike]{bibstyle} 29 | 30 | \DeclareStringOption[ctexfont]{chinesefont} 31 | \DeclareVoidOption{ctexfont}{\ekv{chinesefont=ctexfont}} 32 | \DeclareVoidOption{founder}{\ekv{chinesefont=founder}} 33 | \DeclareVoidOption{nofont}{\ekv{chinesefont=nofont}} 34 | 35 | \DeclareVoidOption{newtx}{\ekv{math=newtx}} 36 | \DeclareVoidOption{mtpro2}{\ekv{math=mtpro2}} 37 | \DeclareVoidOption{cm}{\ekv{math=cm}} 38 | 39 | \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{article}} 40 | \ProcessKeyvalOptions*\relax 41 | \LoadClass{article} 42 | 43 | \RequirePackage{hyperref} 44 | \hypersetup{ 45 | pdfborder={0 0 0}, 46 | colorlinks=true, 47 | linkcolor={winered}, 48 | urlcolor={winered}, 49 | filecolor={winered}, 50 | citecolor={winered}, 51 | linktoc=all, 52 | } 53 | % settings for the hyperref and geometry 54 | \RequirePackage[ 55 | left=1in, 56 | right=1in, 57 | top=1in, 58 | bottom=1in, 59 | headheight=0pt, 60 | headsep=0pt]{geometry} 61 | \setlength{\headsep}{5pt} 62 | 63 | \RequirePackage{amsthm} 64 | \RequirePackage{amsmath} 65 | \RequirePackage{amssymb} 66 | \RequirePackage{indentfirst} 67 | \RequirePackage{booktabs} 68 | \RequirePackage{multicol} 69 | \RequirePackage{multirow} 70 | % \RequirePackage{linegoal} 71 | \RequirePackage{xcolor} 72 | \RequirePackage{graphicx} 73 | \RequirePackage{fancyvrb} 74 | \RequirePackage{abstract} 75 | \RequirePackage{hologo} 76 | 77 | \linespread{1.35} 78 | \graphicspath{{image/}{figure/}{fig/}{img/}} 79 | 80 | % caption settings 81 | \RequirePackage[font=small,labelfont={bf}]{caption} 82 | \captionsetup[table]{skip=3pt} 83 | \captionsetup[figure]{skip=3pt} 84 | 85 | % list/itemize/enumerate setting 86 | \RequirePackage[shortlabels,inline]{enumitem} 87 | \setlist{nolistsep} 88 | 89 | 90 | % define the hyperref color 91 | \RequirePackage{xcolor} 92 | \definecolor{winered}{rgb}{0.5,0,0} 93 | 94 | \definecolor{lightgrey}{rgb}{0.95,0.95,0.95} 95 | \definecolor{commentcolor}{RGB}{0,100,0} 96 | \definecolor{frenchplum}{RGB}{190,20,83} 97 | 98 | 99 | % add the email cmd 100 | \newcommand\email[1]{\href{mailto:#1}{\nolinkurl{#1}}} 101 | 102 | % font settings 103 | 104 | \PassOptionsToPackage{no-math}{fontspec} 105 | \ifdefstring{\ELEGANT@lang}{cn}{ 106 | \ifXeTeX 107 | \ifdefstring{\ELEGANT@chinesefont}{founder}{ 108 | \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex} 109 | \setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01} 110 | \setCJKsansfont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZHei-B01} 111 | \setCJKmonofont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZFangSong-Z02} 112 | \setCJKfamilyfont{zhsong}{FZShuSong-Z01} 113 | \setCJKfamilyfont{zhhei}{FZHei-B01} 114 | \setCJKfamilyfont{zhkai}{FZKai-Z03} 115 | \setCJKfamilyfont{zhfs}{FZFangSong-Z02} 116 | \newcommand*{\songti}{\CJKfamily{zhsong}} 117 | \newcommand*{\heiti}{\CJKfamily{zhhei}} 118 | \newcommand*{\kaishu}{\CJKfamily{zhkai}} 119 | \newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax} 120 | 121 | \ifdefstring{\ELEGANT@chinesefont}{nofont}{ 122 | \RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}}{\relax} 123 | 124 | \ifdefstring{\ELEGANT@chinesefont}{ctexfont}{ 125 | \RequirePackage[UTF8,scheme=plain]{ctex}}{\relax} 126 | \else 127 | \ifdefstring{\ELEGANT@chinesefont}{ctexfont}{ 128 | \RequirePackage[UTF8,scheme=plain]{ctex}}{\relax} 129 | \fi 130 | \AfterEndPreamble{ 131 | % \renewcommand{\itshape}{\kaishu} 132 | \setlength\parindent{2\ccwd}}}{\relax} 133 | 134 | \ifcsname kaishu\endcsname 135 | \newcommand{\citshape}{\kaishu} 136 | \else 137 | \newcommand{\citshape}{\itshape} 138 | \fi 139 | \ifcsname kaishu\endcsname 140 | \newcommand{\cnormal}{\kaishu} 141 | \else 142 | \newcommand{\cnormal}{\normalfont} 143 | \fi 144 | 145 | \ifcsname fangsong\endcsname 146 | \newcommand{\cfs}{\fangsong} 147 | \else 148 | \newcommand{\cfs}{\normalfont} 149 | \fi 150 | 151 | \RequirePackage{newtxtext} 152 | \ifdefstring{\ELEGANT@math}{newtx}{ 153 | \RequirePackage{newtxmath} 154 | \let\Bbbk\relax 155 | \RequirePackage{esint} 156 | %%% use yhmath pkg, uncomment following code 157 | % \let\oldwidering\widering 158 | % \let\widering\undefined 159 | % \RequirePackage{yhmath} 160 | % \let\widering\oldwidering 161 | 162 | %%% use esvect pkg, uncomment following code 163 | % \RequirePackage{esvect} 164 | 165 | \DeclareSymbolFont{CMlargesymbols}{OMX}{cmex}{m}{n} 166 | \let\sumop\relax\let\prodop\relax 167 | \DeclareMathSymbol{\sumop}{\mathop}{CMlargesymbols}{"50} 168 | \DeclareMathSymbol{\prodop}{\mathop}{CMlargesymbols}{"51} 169 | }{\relax} 170 | 171 | \RequirePackage{appendix} 172 | 173 | \ifdefstring{\ELEGANT@lang}{cn}{ 174 | \theoremstyle{plain}% default 175 | \newtheorem{theorem}{定理}[section] % 176 | \newtheorem{lemma}[theorem]{引理} % 177 | \newtheorem{proposition}[theorem]{命题} % 178 | \newtheorem*{corollary}{推论} % 179 | \theoremstyle{definition} % 180 | \newtheorem{definition}{定义}[section] % 181 | \newtheorem{conjecture}{猜想}[section] % 182 | \newtheorem{example}{例}[section] % 183 | \theoremstyle{remark} % 184 | \newtheorem*{remark}{\normalfont\bfseries 评论} % 185 | \newtheorem*{note}{\normalfont\bfseries 注} % 186 | \newtheorem{case}{\normalfont\bfseries 案例} % 187 | \renewcommand*{\proofname}{\normalfont\bfseries 证明} % 188 | \renewcommand\contentsname{目录} 189 | \renewcommand\refname{参考文献} % 190 | \renewcommand\figurename{图} % 191 | \renewcommand\tablename{表}% 192 | \newcommand\versiontext{版本:}% 193 | \newcommand\updatetext{日期:}% 194 | \renewcommand\abstractname{摘\hspace{2em}要} 195 | \setlength\parindent{2\ccwd} 196 | \renewcommand{\abstracttextfont}{\small\citshape\noindent\ignorespaces} 197 | % 新定义命令 198 | \newcommand{\keywords}[1]{\vskip2ex\par\noindent\normalfont{\bfseries 关键词: } #1} 199 | \newcommand\figref[1]{{\bfseries 图~\ref{#1}}} 200 | \newcommand\tabref[1]{{\bfseries 表~\ref{#1}}} 201 | \RequirePackage{gbt7714} 202 | \ifdefstring{\ELEGANT@cite}{authoryear}{ 203 | \bibliographystyle{gbt7714-author-year}}{ 204 | \bibliographystyle{gbt7714-numerical}} 205 | \ifdefstring{\ELEGANT@cite}{numbers}{ 206 | \citestyle{numbers}}{\relax} 207 | \renewcommand{\appendixtocname}{附录} 208 | \renewcommand{\appendixpagename}{附录}}{\relax} 209 | 210 | \ifdefstring{\ELEGANT@lang}{en}{ 211 | \theoremstyle{plain}% default 212 | \newtheorem{theorem}{Theorem}[section] % 213 | \newtheorem{lemma}[theorem]{Lemma} % 214 | \newtheorem{proposition}[theorem]{Proposition} % 215 | \newtheorem*{corollary}{Corollary} % 216 | \theoremstyle{definition} % 217 | \newtheorem{definition}{Definition}[section] % 218 | \newtheorem{conjecture}{Conjecture}[section] % 219 | \newtheorem{example}{Example}[section] % 220 | \theoremstyle{remark} % 221 | \newtheorem*{remark}{Remark} % 222 | \newtheorem*{note}{Note} % 223 | \newtheorem{case}{Case} % 224 | \renewcommand*{\proofname}{\normalfont\bfseries Proof}% 225 | \newcommand\versiontext{\itshape Version: }% 226 | \newcommand\updatetext{\itshape Date: }% 227 | \setlength\parindent{2em} 228 | \renewcommand{\abstracttextfont}{\sffamily\small\noindent\ignorespaces} 229 | % newcommands defined in this template. 230 | \newcommand{\keywords}[1]{\vskip 2ex\par\noindent\normalfont{\bfseries Keywords: } #1} 231 | \newcommand\figref[1]{{\bfseries Figure~\ref{#1}}} 232 | \newcommand\tabref[1]{{\bfseries Table~\ref{#1}}} 233 | \RequirePackage[\ELEGANT@cite,sort&compress]{natbib} 234 | \bibliographystyle{\ELEGANT@bibstyle}}{\relax} 235 | 236 | \setlength{\bibsep}{0.0pt} 237 | \def\bibfont{\footnotesize} 238 | 239 | \AtBeginEnvironment{verbatim}{\microtypesetup{activate=false}} 240 | \BeforeBeginEnvironment{tabular}{\small} 241 | \AfterEndEnvironment{tabular}{} 242 | 243 | \AtBeginDocument{ 244 | \setlength{\abovedisplayskip}{3pt} 245 | \setlength{\belowdisplayskip}{3pt} 246 | \RequirePackage[flushmargin]{footmisc} 247 | \setlength{\footnotesep}{12pt}} 248 | 249 | \def\IfEmpty#1{% 250 | \edef\1{\the#1} 251 | \ifx\1\empty 252 | } 253 | \newtoks\version 254 | \newtoks\institute 255 | 256 | \renewcommand\maketitle{\par 257 | \begingroup 258 | \renewcommand\thefootnote{\@fnsymbol\c@footnote}% 259 | \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% 260 | \long\def\@makefntext##1{\parindent 1em\noindent 261 | \hb@xt@0.1em{% 262 | \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% 263 | \if@twocolumn 264 | \ifnum \col@number=\@ne 265 | \@maketitle 266 | \else 267 | \twocolumn[\@maketitle]% 268 | \fi 269 | \else 270 | \newpage 271 | \global\@topnum\z@ % Prevents figures from going at top of page. 272 | \@maketitle 273 | \fi 274 | \thispagestyle{plain}\@thanks 275 | \endgroup 276 | \setcounter{footnote}{0}% 277 | \global\let\thanks\relax 278 | \global\let\maketitle\relax 279 | \global\let\@maketitle\relax 280 | \global\let\@thanks\@empty 281 | \global\let\@author\@empty 282 | \global\let\@ELEGANT@version\@empty 283 | \global\let\@date\@empty 284 | \global\let\@title\@empty 285 | \global\let\title\relax 286 | \global\let\author\relax 287 | \global\let\date\relax 288 | \global\let\and\relax 289 | \global\let\ELEGANT@version\relax 290 | } 291 | \def\@maketitle{% 292 | \newpage 293 | \null 294 | \vskip 2em% 295 | \begin{center}% 296 | \let \footnote \thanks 297 | {\LARGE\bfseries \@title \par}% 298 | \vskip 1.5em% 299 | {\large 300 | \lineskip .5em% 301 | \begin{tabular}[t]{c}% 302 | \@author\\[1ex] 303 | \end{tabular}\par} 304 | \the\institute% 305 | \vskip 0.5ex% 306 | \IfEmpty\version 307 | \else 308 | {\small\normalfont\citshape\versiontext\the\version} 309 | \fi 310 | \ifx\@date\empty 311 | \else 312 | \vskip 0.1em% 313 | {\small\normalfont\citshape\updatetext\@date}% 314 | \fi 315 | \end{center}% 316 | \par 317 | } 318 | 319 | 320 | \RequirePackage{listings} 321 | \renewcommand{\ttdefault}{cmtt} 322 | 323 | \lstdefinestyle{estyle}{ 324 | basicstyle=% 325 | \ttfamily 326 | \lst@ifdisplaystyle\footnotesize\fi 327 | } 328 | \lstset{basicstyle=\scriptsize\ttfamily,style=estyle} 329 | 330 | \lstset{language=[LaTeX]TeX, 331 | texcsstyle=*\color{winered}, 332 | numbers=none, 333 | breaklines=true, 334 | keywordstyle=\color{winered}, 335 | frame=tlbr,framesep=4pt,framerule=0pt, 336 | commentstyle=\color{commentcolor}, 337 | % emph={elegantpaper,fontenc,fontspec,xeCJK,FiraMono,xunicode,newtxmath,figure,fig,image,img,table,itemize,enumerate,newtxtext,newtxtt,ctex,microtype,description,times,newtx,booktabs,tabular,PDFLaTeX,XeLaTeX,type1cm,BibTeX,cite,gbt7714,lang}, 338 | emphstyle={\color{frenchplum}}, 339 | % morekeywords={DeclareSymbolFont,SetSymbolFont,toprule,midrule,bottomrule,institute,version,includegraphics,setmainfont,setsansfont,setmonofont ,setCJKmainfont,setCJKsansfont,setCJKmonofont,RequirePackage,figref,tabref,email,maketitle,keywords,zhdate,zhtoday}, 340 | tabsize=2, 341 | backgroundcolor=\color{lightgrey} 342 | } 343 | 344 | 345 | 346 | 347 | 348 | 349 | -------------------------------------------------------------------------------- /Assignments/Report/main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osslab-pku/OSSDevelopment/66417ef3400f73d97533be9e3e465f111d6bb5ba/Assignments/Report/main.pdf -------------------------------------------------------------------------------- /Assignments/Report/main.tex: -------------------------------------------------------------------------------- 1 | \documentclass[lang=cn,11pt,a4paper,cite=authoryear]{elegantpaper} 2 | 3 | \usepackage{tcolorbox} 4 | 5 | \title{《开源软件技术》课程项目期末报告} 6 | \author{ 7 | <姓名>\\<学号>\\\email{xxxxx@pku.edu.cn} 8 | } 9 | \date{} 10 | 11 | \begin{document} 12 | 13 | \maketitle 14 | 15 | \section{开源项目概览} 16 | 17 | \begin{tcolorbox}[title=\textbf{请在这一节包含如下内容:},colback=yellow!10!white] 18 | 列出你做出贡献的开源项目及其链接;对每一个开源项目: 19 | \begin{enumerate} 20 | \item 请介绍其基本情况(例如,这个项目用于什么目的?是如何产生和发展的?主要贡献者是谁?成熟度和活跃度如何?使用了什么许可证?是否存在特定的组织模式和商业模式?等等); 21 | \item 请介绍其贡献指南及开发流程(例如:项目提供了哪些贡献指南?包含了哪些内容?项目使用了什么工具链?是否使用了CI/CD?如果是,包含了哪些流程?等等); 22 | \item 请介绍你决定向该项目做贡献的历程(例如,你是如何得知这个开源项目的?这个项目的什么地方吸引到了你?为什么对这个开源项目产生了贡献的动机?等等)。 23 | \end{enumerate} 24 | \end{tcolorbox} 25 | 26 | \section{对开源项目的贡献} 27 | 28 | \begin{tcolorbox}[title=\textbf{请在这一节包含如下内容:},colback=yellow!10!white] 29 | 用一段话总结你提交的所有贡献,完成表格~\ref{tab:contrib};对每一个贡献,请在对应的小节里: 30 | \begin{enumerate} 31 | \item 描述这是一个什么贡献; 32 | \item 描述这个贡献的定位和解决过程(如何定位确定要做这个贡献?与其他开发者做的沟通?遇到了什么困难?有没有经过多轮修改?等等); 33 | \item 在整个过程中,你的贡献经过了哪些质量检查(如果有)?(例如,添加新的单元测试、由核心开发者进行的代码审查,等等) 34 | \item 这个贡献是否被接受?如果没有,是为什么? 35 | \end{enumerate} 36 | \end{tcolorbox} 37 | 38 | \begin{table}[] 39 | \centering 40 | \caption{对开源项目的贡献概览(已有内容仅供格式举例,请替换成你的贡献)} 41 | \begin{tabular}{llp{9cm}} 42 | \toprule 43 | 项目 & 贡献 & 相关链接 \\ 44 | \midrule 45 | GFI-Bot & 为\texttt{gfibot.data}模块添加日志 & \url{https://github.com/osslab-pku/gfi-bot/issues/13} \newline \url{https://github.com/osslab-pku/gfi-bot/pull/15}\\ 46 | \bottomrule 47 | \end{tabular} 48 | \label{tab:contrib} 49 | \end{table} 50 | 51 | \subsection{贡献一:XXXXX} 52 | 53 | \subsection{贡献二:YYYYY} 54 | 55 | \subsection{...} 56 | 57 | \section{总结与反思} 58 | 59 | \subsection{计划外的变化} 60 | 61 | \begin{tcolorbox}[title=\textbf{请在这一节包含如下内容(如果有):},colback=yellow!10!white] 62 | \begin{enumerate} 63 | \item 你是否尝试对一些开源项目做贡献,但是最后失败了?为什么会失败?后来你又是如何切换开源项目的? 64 | \item 你是否尝试去解决一些开源项目的Issue,但是最后失败了?为什么会失败? 65 | \item 在开源项目的贡献过程中有哪些你没预期到的困难?你是如何克服这些困难的? 66 | \end{enumerate} 67 | \end{tcolorbox} 68 | 69 | \subsection{对开源的体会、理解与思考} 70 | 71 | \begin{tcolorbox}[title=\textbf{请在这一节中写下任何你想要表达的内容,下述问题仅供参考:},colback=yellow!10!white] 72 | 你认为开源机制靠什么成功?在完成课程项目的过程中,你对开源模式和开源项目产生了哪些印象和体会?从参与开源中,你学到了什么东西?未来是否会继续参与开源? 73 | \end{tcolorbox} 74 | 75 | \subsection{对课程的建议} 76 | 77 | \begin{tcolorbox}[colback=yellow!10!white] 78 | 请在这里写下任何对课程的意见和建议(可选,不计入报告评分)。 79 | \end{tcolorbox} 80 | 81 | 82 | \nocite{*} 83 | \bibliography{references} 84 | 85 | \end{document} 86 | -------------------------------------------------------------------------------- /Assignments/Report/references.bib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osslab-pku/OSSDevelopment/66417ef3400f73d97533be9e3e465f111d6bb5ba/Assignments/Report/references.bib -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | . 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## 此项目的目的 4 | 5 | 1. 群智产出相关的教材和课件; 6 | 2. 开放交流教学方法和过程; 7 | 3. 吸收最新开源知识并迭代,时刻保持此课程的最佳实践。 8 | 9 | ## 如何做贡献? 10 | 11 | 以上述项目目的为驱动做贡献。例如: 12 | 13 | 1. 修改大纲; 14 | 2. 修改/增加课件; 15 | 3. 修改/增加作业; 16 | 4. 老师角度:怎么组织课堂,采用什么案例? 17 | 5. 学生角度:怎么学习? 18 | 6. 企业角度:如何宣传其开源项目,如何引导同学们围绕其开源项目和任务做贡献? 19 | 7. 开源布道师角度:怎么宣传开源文化? 20 | 21 | 在做大幅度修改前,请先发起一个[Discussion](https://github.com/osslab-pku/OSSDevelopment/discussions),与我们达成共识后,再提交PR或由我们作出修改 22 | 23 | ## 开源项目招募! 24 | 25 | 本课程的课程项目要求学生参与开源项目并做出实际贡献(报告Issue、修复bug、增加feature、编写文档、...) 26 | 27 | 在此过程中,开源项目的参与至关重要, 28 | 29 | * 为学生选择想要参与的开源项目提供线索; 30 | * 为学生进入开源项目提供精细化指南; 31 | * 为学生宣讲和展现开源技术和文化。 32 | 33 | 如果您是开源项目的维护者,且您希望对您的项目进行校园宣传和招新,可在此发起[Discussion](https://github.com/osslab-pku/OSSDevelopment/discussions),提供项目介绍和联系方式;或者发送邮件联系:zhmh@pku.edu.cn。可选的宣传方式: 34 | 35 | * 提供相关资料(尤其是有关新人如何上手的资料),整合在本仓库中,我们在课程上进行介绍 36 | * 如果条件允许,在北京大学的课程上作现场报告/宣讲 37 | 38 | 之前做过宣讲的项目包括:PaddlePaddle、openEuler、TiDB、等等 39 | 40 | ## 将相关材料用于教学 41 | 42 | 在遵循[木兰宽松许可证](LICENSE)的前提下,可复用本仓库中的材料用于您的课堂教学,无需事先获得许可。我们非常欢迎您提交PR,在README.md中列出您的课程 43 | 44 | 如有其他需求,请联系zhmh@pku.edu.cn 45 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | ## 项目维护者 2 | 3 | * [周明辉](https://minghuizhou.github.io/) 北京大学博雅特聘教授 4 | 5 | ## 项目贡献者 6 | 7 | * [何昊: 2022学期助教](https://hehao98.github.io) 北京大学 8 | 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 木兰宽松许可证, 第2版 2 | 3 | 2020年1月 http://license.coscl.org.cn/MulanPSL2 4 | 5 | 您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束: 6 | 7 | 0. 定义 8 | 9 | “软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。 10 | 11 | “贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。 12 | 13 | “贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。 14 | 15 | “法人实体” 是指提交贡献的机构及其“关联实体”。 16 | 17 | “关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。 18 | 19 | 1. 授予版权许可 20 | 21 | 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。 22 | 23 | 2. 授予专利许可 24 | 25 | 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。 26 | 27 | 3. 无商标许可 28 | 29 | “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。 30 | 31 | 4. 分发限制 32 | 33 | 您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。 34 | 35 | 5. 免责声明与责任限制 36 | 37 | “软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。 38 | 39 | 6. 语言 40 | 41 | “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。 42 | 43 | 条款结束 44 | 45 | 如何将木兰宽松许可证,第2版,应用到您的软件 46 | 47 | 如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步: 48 | 49 | 1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字; 50 | 51 | 2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中; 52 | 53 | 3, 请将如下声明文本放入每个源文件的头部注释中。 54 | 55 | Copyright (c) [Year] [name of copyright holder] 56 | [Software Name] is licensed under Mulan PSL v2. 57 | You can use this software according to the terms and conditions of the Mulan PSL v2. 58 | You may obtain a copy of Mulan PSL v2 at: 59 | http://license.coscl.org.cn/MulanPSL2 60 | THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 61 | EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 62 | MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 63 | See the Mulan PSL v2 for more details. 64 | Mulan Permissive Software License,Version 2 65 | Mulan Permissive Software License,Version 2 (Mulan PSL v2) 66 | 67 | January 2020 http://license.coscl.org.cn/MulanPSL2 68 | 69 | Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions: 70 | 71 | 0. Definition 72 | 73 | Software means the program and related documents which are licensed under this License and comprise all Contribution(s). 74 | 75 | Contribution means the copyrightable work licensed by a particular Contributor under this License. 76 | 77 | Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License. 78 | 79 | Legal Entity means the entity making a Contribution and all its Affiliates. 80 | 81 | Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity. 82 | 83 | 1. Grant of Copyright License 84 | 85 | Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not. 86 | 87 | 2. Grant of Patent License 88 | 89 | Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken. 90 | 91 | 3. No Trademark License 92 | 93 | No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in section 4. 94 | 95 | 4. Distribution Restriction 96 | 97 | You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software. 98 | 99 | 5. Disclaimer of Warranty and Limitation of Liability 100 | 101 | THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 102 | 103 | 6. Language 104 | 105 | THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL. 106 | 107 | END OF THE TERMS AND CONDITIONS 108 | -------------------------------------------------------------------------------- /Projects.md: -------------------------------------------------------------------------------- 1 | # Open-Source Projects 2 | 3 | ## [Ancient Beast](https://github.com/FreezingMoon/AncientBeast) 4 | 5 | AncientBeast is a free open source match-based game playable at https://AncientBeast.com and developed at https://github.com/FreezingMoon/AncientBeast. 6 | If you are interested on games and game programming, this can be the project for you. 7 | To start development, join [the Discord server](https://discord.gg/x78rKen) and find a list of easy issues [here](https://github.com/FreezingMoon/AncientBeast/issues?q=is%3Aopen+is%3Aissue+label%3Aeasy). 8 | -------------------------------------------------------------------------------- /PublicizingMaterials/README.md: -------------------------------------------------------------------------------- 1 | # Publicizing Materials // 宣传材料 2 | 3 | 本文件夹存放用于课程宣传的相关材料,包括但不限于: 4 | 5 | ## 大会报告PPT/PDF: 6 | 7 | 1. **2021.07.16**:CCF 2022未来计算机教育峰会(FCES 2022),[用开源教开源](PublicizingMaterials\用开源教开源:“开源软件开发”课程-20210716-zhmh.pdf) 8 | -------------------------------------------------------------------------------- /PublicizingMaterials/用开源教开源:“开源软件开发”课程-20210716-zhmh.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osslab-pku/OSSDevelopment/66417ef3400f73d97533be9e3e465f111d6bb5ba/PublicizingMaterials/用开源教开源:“开源软件开发”课程-20210716-zhmh.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OSSDevelopment //《开源软件开发/技术》课程 2 | 3 | 本课程主要面向大学计算机系本科生和研究生设计,希望通过本课程的教学,使得计算机领域的同学们能够: 4 | 1. 对于开源软件的开发方法、开发过程和支持技术有深入的了解; 5 | 2. 对于如何将抽象方法和理论知识结合到工程中有更好的锻炼; 6 | 3. 对于开源软件社区参与有基本的掌握,具备参与开源软件开发的基本能力。 7 | 8 | ## 课程背景 9 | 10 | 开源软件在科学研究、工业制造、以及日常生活中发挥着重要作用。近年来,开源软件在云计算、大数据、人工智能等新兴领域迅速成为技术主流。开源软件不仅在计算机科学和软件工程中扮演了重要的角色,也成为了社会生活所依赖的关键基础设施。国内很多IT公司也在逐渐推出高质量的开源项目,例如openEuler、TiDB、OceanBase、PaddlePaddle等。开源已经成为软件技术创新和软件产业发展的主要模式。 11 | 12 | 与传统开发模式相比,开源开发展现出充分共享、自由协同、无偿贡献、用户创新、持续演化的新特征,颠覆了诸多经典软件工程的基本假设和理论。越来越多的IT公司在内部推行开源理念和开发方法,以期提高创新能力以及开发效率和质量等。相比传统软件开发,开源软件开发有一套新的模型和技术。然而,鉴于相关课程的缺乏,广大同学们往往对此缺乏理解和实践;而初学者在试图对开源软件做出贡献时,通常会感到无从下手,困难重重。因此,我们开设此课程,以帮助计算机领域的同学们了解开源软件开发和开源社区参与,这是现时代技术环境下亟待掌握的基本知识。 13 | 14 | ## 先置知识 15 | 16 | 1. (必须)熟练掌握至少一门编程语言 17 | 2. (必须)具备基本的英语沟通交流能力 18 | 3. (推荐)对开源和计算机技术有兴趣,有想要做出贡献的领域,希望培养自我驱动力和锻炼自主学习能力 19 | 4. (可选)开发过有一定规模的软件项目,或阅读过软件工程有关书籍,或选修过软件工程相关课程 20 | 21 | 22 | ## 内容提要 23 | 24 | 本课程采用理论知识和开源实践相结合的方式进行设计,从开源模式出发,以学生参与开源项目的实践为整体线索,讲授开源软件开发方法、过程及其涉及的理论知识和技术,具体包含如下内容: 25 | 26 | 1. **开源模式:** 开源历史发展;互联网协作技术的演变和革新;工业界开源布道师分享;... 27 | 2. **开源开发活动:** 开源开发流程、社区维护/协作模式、贡献指南、如何沟通、Issues、Pull-Based Development、... 28 | 3. **相关流程、工具和最佳实践:** git、GitHub/Gitee/GitLab、CI/CD/DevOps、Code Review、Good First Issue、... 29 | 4. **前沿研究和实践:** 开源社区治理、商业协作、开源生态系统、开源软件供应链管理、安全性/可持续性问题、相关实证研究方法、... 30 | 31 | 课程的主要考核方式如下(每学期会有所调整,以最终发布的课程作业为准): 32 | 33 | 1. **实践作业(Lab):** 创建GitHub项目、提交PR、配置CI/CD流水线、发布开源软件包、... 34 | 2. **报告:** 开源项目和任务选择、Linux Kernel中的沟通实践、前沿学术论文阅读、... 35 | 3. **课程项目:** 选择某个开源项目并做出实际贡献,在课程上报告进展和思考,并提交期末报告 36 | 37 | ## 学分/学时分配 38 | 39 | 课程为3学分,总学时为48学时(3*16),大致学时分配:课程讲授占50%,学生的文献阅读和讨论占20%,学生参与开源项目的实践报告占30%。 40 | 41 | ## 文件结构 42 | 43 | * [Syllabus.md](Syllabus.md):课程大纲(包含课程作业概览和评分标准) 44 | * [Slides](Slides/):课程课件 45 | * [Assignments](Assignments/):课程作业 46 | * [PublicizingMaterials](PublicizingMaterials/):课程相关宣传/研讨材料,例如大会报告 47 | 48 | ## 如何贡献 49 | 50 | * **在我们的课程上宣传您的开源项目!** 详见[CONTRIBUTING.md](CONTRIBUTING.md#开源项目招募) 51 | * 希望使用相关材料用于您的教学?请[联系我们](CONTRIBUTING.md#将相关材料用于教学) 52 | * 认为课程设计和作业设计存在不足?有任何意见和建议?请发起一个[Discussion](https://github.com/osslab-pku/OSSDevelopment/discussions) 53 | * 在任何地方发现了Typo、Bug、或格式问题?请开启一个[Issue](https://github.com/osslab-pku/OSSDevelopment/issues)或者直接提交[Pull Request](https://github.com/osslab-pku/OSSDevelopment/pulls) 54 | 55 | 关于贡献指南相关、和项目开发的基本约定等更多信息,请参见[CONTRIBUTING.md](CONTRIBUTING.md) 56 | 57 | ## 使用本仓库的课程 58 | 59 | 1. 北京大学信息科学技术学院,《开源软件技术》 60 | * 2021-2022学年秋季学期、2022-2023学年秋季学期、2023-2024学年秋季学期、2024-2025学年秋季学期 61 | 62 | 2. 跟头歌共建的实训课程参见:https://www.educoder.net/paths/9i8a7og6 63 | -------------------------------------------------------------------------------- /Slides/lecture1-开源和生态及其研究介绍.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osslab-pku/OSSDevelopment/66417ef3400f73d97533be9e3e465f111d6bb5ba/Slides/lecture1-开源和生态及其研究介绍.pdf -------------------------------------------------------------------------------- /Slides/lecture201-Git教程.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osslab-pku/OSSDevelopment/66417ef3400f73d97533be9e3e465f111d6bb5ba/Slides/lecture201-Git教程.pdf -------------------------------------------------------------------------------- /Slides/lecture202-使用GitHub进行项目托管.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osslab-pku/OSSDevelopment/66417ef3400f73d97533be9e3e465f111d6bb5ba/Slides/lecture202-使用GitHub进行项目托管.pdf -------------------------------------------------------------------------------- /Slides/lecture301-贡献指南.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osslab-pku/OSSDevelopment/66417ef3400f73d97533be9e3e465f111d6bb5ba/Slides/lecture301-贡献指南.pdf -------------------------------------------------------------------------------- /Slides/lecture701-CI&CD&Devops.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osslab-pku/OSSDevelopment/66417ef3400f73d97533be9e3e465f111d6bb5ba/Slides/lecture701-CI&CD&Devops.pdf -------------------------------------------------------------------------------- /Slides/readme.txt: -------------------------------------------------------------------------------- 1 | This directory provides slides related to this course (2024). 2 | -------------------------------------------------------------------------------- /Syllabus.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2023 [minghuizhou@osslab-pku] 2 | [OSSDevelopment-course/开源软件开发&技术课程] is licensed under Mulan PSL v2. 3 | You can use this software according to the terms and conditions of the Mulan PSL v2. 4 | You may obtain a copy of Mulan PSL v2 at: 5 | http://license.coscl.org.cn/MulanPSL2 6 | THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 7 | EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 8 | MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 9 | See the Mulan PSL v2 for more details. 10 | 11 | # 2024年秋冬学期——课程大纲 (subject to change) 12 | 13 | **主要内容: 开源开发方法、技术和实践OSP + 开源文化OSC + 上机实习lab + 课程项目PRJ** 14 | 15 | 授课教师:周明辉 16 | 17 | 助教: 徐卫伟 xuww@stu.pku.edu.cn 18 | 19 | 20 | ## 第1次课:开源软件及其开发概述(课堂lecture) 09/11 21 | 22 | * 100课程简介:课程的目的和内容,以及课程的考核形式。 **lecture100** 23 | * 101开源软件概述:开源的定义、历史和现状、社区结构和治理,以及开源研究。 **lecture101** 24 | * 102往年贡献: 以特定GitHub项目/任务为例,展示如何做贡献;以及讲述往年同学的贡献历程和体会。(消除畏惧感) 25 | 26 | 27 | ## 第2次课:开源开发的支持平台和关键技术:熟悉开源平台和Git操作(课堂lecture) 09/18 28 | 29 | * 201:Git实践入门 **lecture201** 30 | - 了解版本控制,了解使用Git,https://missing.csail.mit.edu/2020/version-control/ 31 | * 202:GitHub实践入门 **lecture202** 32 | - 了解如何用开源协作工具,熟悉Github/Gitee/GitLink--建立账号和代码仓库,浏览和fork项目 33 | 34 | 课堂练习: 35 | * 阅读并了解Lab1。 36 | 37 | > **Lab 1:练习使用git和GitHub(7分,两周)** 38 | > - 注册GitHub账号 39 | > - 加入课程的[Organization](https://github.com/OSS-Dev-Course-PKU) 40 | > - 创建GitHub仓库并添加commit,于README.md写下目前的开源项目贡献想法 41 | > 42 | > **Lab 1扩展:练习使用issue、fork和PR** 43 | > - 提交一个issue,描述自己的想法(相比较于第一次提交)做出了哪些变化 44 | > - 将仓库fork到自己的账号下,对README.md做出相应修改并提出一个PR,并解决产生的冲突 45 | > 46 | > Lab 1详细要求参见[WriteUp](Assignments/Lab1.md),**截止日期:2024.10.03 11:59am** 47 | 48 | ## 第3次课:开源贡献指南(课堂lecture) 09/25 49 | 50 | * 301:开源贡献指南: **lecture301** 51 | - learn how the open source community works; 52 | - criteria to select open source project and task to participate in. 53 | 54 | * 302:开源课程评分依据: **lecture302** 55 | 56 | > **Lab 2:了解开源项目的开发方式和贡献流程(7分,两周)** 57 | > 58 | > 任意选择一个活跃、成熟的开源项目: 59 | > - 了解并报告CONTRIBUTING.md的形式和内容 60 | > - 回答有关其贡献流程、质量管理方式等若干问题 61 | > 62 | > Lab 2详细要求参见[WriteUp](Assignments/Lab2.md),**截止日期:2024.10.10 11:59am** 63 | 64 | ## 第4次课:开源项目maintainer分享其维护/开发的经验。(多个项目,开拓视野&为开源任务选择做准备) 10/9 65 | 66 | * 开源项目的分享:项目介绍、技术介绍、项目常用规则、如何参与。 67 | * 飞桨paddlepaddle:开源社区分享的介绍请看这里(内含课程的ppt在线浏览):[飞桨开源社区走进北京大学课堂](https://pfcc.blog/posts/pku-course)。 68 | * 涛思数据TDEngine 69 | * SRS 70 | * piFlow 71 | 72 | ## 第5次课:开源任务的选择。(课堂lecture) 10/16 73 | * 501:如何选择开源任务参与,GitHub Good First Issue **lecture501** 74 | 75 | > **Lab 3:在开源项目中选择开发任务(8分,两周)** 76 | > 77 | > - 选择一个或者多个感兴趣的开源项目,探索并报告: 78 | > * 是否具有Good First Issue机制 79 | > * 如果你需要在其中选择开发任务,你会如何做 80 | > 81 | > Lab 3详细要求参见[WriteUp](Assignments/Lab3.md),**截止日期:2024.11.14 11:59am** 82 | 83 | ## 第6次课:(课程项目开题报告)选择开源项目和开源任务 10/23 84 | * 学生报告, 85 | 1)初始选择了什么开源项目和任务; 86 | 2)对此开源项目及其指南的认识; 87 | 3)贡献计划。 88 | 89 | ## 第7次课:CI/CD(上机实习) 10/30 90 | 91 | > **Lab 4:CI/CD流水线搭建(10分,两周)** 92 | > 93 | > 了解CI/CD流程管理工具GitHub Action,知道如何编写简单的CI/CD流水线,并且在实践项目上完成符合要求的成功构建 94 | > 95 | > Lab 4详细要求参见[WriteUp](Assignments/Lab4.md),**截止日期:2024.11.21 11:59am** 96 | > 97 | > 4Fun: 2021课程实习过程中关于gitee go的建议:https://toscode.gitee.com/pitcher/gitee-go-exercise/issues 98 | 99 | 100 | ## 第8次课:从经典软工到开源开发。(课堂lecture) 11/06 101 | * 501:从经典软工到开源开发 **lecture501** 102 | 103 | ## 第10次课:开源开发中的沟通实践(课堂lecture) 11/13 104 | * 601: 协作和沟通的重要性,如何沟通,分布式沟通中的要点,如何提交PR等。**lecture601** 105 | 106 | > **Lab 6:开源项目中的沟通实践(8分,两周)** 107 | > 108 | > 阅读Linux Kernel沟通实践相关资料,体会总结开源沟通的最佳实践。 109 | > or, 选择任何一个开源项目,阅读体会其沟通实践,总结最佳实践。 110 | > (8分) 111 | > 112 | > - 提交issue时如何参与讨论,如何沟通 113 | > - 提交pr时如何沟通 114 | > 115 | > Lab 6详细要求参见[WriteUp](Assignments/Lab6.md),**截止日期:2024.11.28 11:59am** 116 | 117 | 118 | ## 第9次课:PyPI/NPM等包生态系统/包管理工具,使用/打包/上载软件包(上机实习) 11/20 119 | 120 | > **Lab 5:Python开源软件包安装/管理/打包/上载(10分,三周)** 121 | > 122 | > - 使用Poetry进行Python包的安装、管理与打包; 123 | > - 利用依赖对Python包实现新功能; 124 | > - 将自己的Python包手动发布到TestPyPI; 125 | > - 配置自动化的CI/CD流水线实现从GitHub直接发布Python包到TestPyPI(注意,不是PyPI平台。[TestPyPI](https://test.pypi.org)是与PyPI分离的Python包发布平台,使练习时发布的Python包不会影响到真正的生态) 126 | > 127 | > Lab 5详细要求参见[WriteUp](Assignments/Lab5.md),**截止日期:2024.12.12 11:59am** 128 | 129 | 130 | 131 | ## 第11次课:(课程项目进度报告)任务选择/合作反馈/工具使用等 PRJ-2 11/27 132 | 133 | ## 第12次课:开源的几个关键问题:(课堂lecture) 12/04 134 | * 开源为什么能成功? 135 | * 开源模式会主宰未来吗? 136 | * 什么是“卡脖子”问题? 137 | 138 | 139 | ## 第13次课:开源相关的研究(课堂lecture和讨论) 12/11 140 | * Talks from Daniel and Sean; 141 | * Talks from Phd students. 142 | * 开源数字社会学(数据驱动的开源研究,研究对象:软件~开发者,软件供应链~个体效率/群体协作/生态持续性) 143 | * 发现型和发明型研究案例 144 | * 第三方库推荐,从三方库迁移的现象理解到智能推荐工具 145 | * 新手任务推荐,从理解新手任务的性质到智能推荐工具 146 | 147 | 148 | ## 第14次课:开源商业模式(课堂lecture) 12/18 149 | * 公司为什么参与开源? 150 | * 开源商业模式有哪些? 151 | * 学生选择案例(特定公司和特定开源项目),说明其开源商业模式。 152 | 153 | ## 第15次课:课程项目结题报告 PRJ-3 12/25 154 | 英明神武的同学们的最终报告。 155 | 156 | > 最后一次课之后需要提交课程项目最终报告(LaTeX格式),**截止日期:2025.1.9 11:59am** 157 | > 158 | > 课程项目的详细要求参见[WriteUp](Assignments/Project.md) 159 | 160 | ## 评分标准 161 | 162 | * 课堂表现(10分): 163 | - 上课参与讨论、提问,若点名未到且未事先请假,一次扣2分,最多10分 164 | - 课堂表现优秀者,视情况酌情加分 165 | * 上机实习Lab(6个,共50分): 166 | - Git/贡献指南/GFI/沟通,7~8分一个,共30分 167 | - CI/CD和包管理,10分一个,共20分 168 | * 课程项目PRJ(40分): 169 | - 3次presentation(开题/中期/结题),每次5分 170 | - 期末报告(in latex)10分 171 | - 最后的贡献结果15分 172 | --------------------------------------------------------------------------------