Quera技术挑战的构建系统
项目描述
qbuild 是Quera技术挑战的构建系统。
安装
要安装qbuild,请运行以下命令
$ sudo pip install qbuild
挑战结构
challenge-name (git repo)
├── src
│ ├── [ ... source and test files ... ]
│ ├── .gitignore (optional)
│ ├── .qignore (optional)
│ ├── .qsolution (optional)
│ ├── .qtest (optional, BUT USUALLY NEEDED)
│ └── .qrun.py (optional)
├── statement
│ ├── attachments
│ │ └── [ ... image files ... ]
│ └── statement.md
├── .gitignore
├── README.md (generated from statement/statement.md, DO NOT EDIT)
├── tester_config.json
└── valid_files
CLI用法
qbuild
:构建挑战
首先,使用cd
命令进入挑战git仓库的根目录。然后运行qbuild
命令。就这样!
$ cd GIT-REPO
$ qbuild
对于需要生成非Quera初始的jupyter
问题
$ qbuild --jupyter
将生成dist
文件夹和README.md
文件。它为其内部工作创建.qbuild
文件夹。不要推送它。将dist
和.qbuild
添加到gitignore中。
qbuild diff
$ cd GIT-REPO
$ qbuild diff
此命令生成initial
和model_solution
导出之间的diff。
这对于检查设置是否正确非常有用。
qbuild tree
$ qbuild tree path/to/some/directory
使用qbuild tree
打印目录的树结构。不要使用tree
命令或其他任何命令。
qbuild --version
打印当前安装的版本。
功能
问题声明
statement
├── attachments
│ ├── image1.png
│ └── image2.png
└── statement.md
statement.md
是一个Jinja2模板,必须继承statement_base.md
。您可以使用变量 has_initial
、initial_structure
、solution_structure
。
{% extends "statement_base.md" %}
{% block name %}Problem Name{% endblock %}
{% block readme %}
... extra info about problem ...
{% endblock readme %}
{% block intro %}
... intro ...

{% endblock intro %}
{% block details %}
... details ...
{% endblock details %}
{% block notes %}
... notes ...
```
{{ solution_structure }}
```
{% endblock notes %}
忽略文件: .qignore
、.qsolution
、.qtest
、.qsampletest
这些文件必须位于src
文件夹的根目录。它们的语法类似于gitignore。您可以在.qtest
中指定测试文件。您可以在.qsampletest
中指定样本测试文件。这些文件仅在model_solution
导出中隐藏,并在.qsolution
中指定解决方案文件。由.qignore
忽略的文件将在所有导出中删除。
警告:.qhide
已弃用,并由.qsolution
替换。
替换规则:注释指令
// _q_solution_begin
... Part of Solution ...
// _q_end
// _q_test_begin
... Part of Test ...
// _q_end
它们也可以有replace
块
// _q_solution_begin
... Part of Solution ...
// _q_replace
// ... This will be uncommented & replaced ...
// _q_end
/* _q_test_begin */
... Part of Test ...
/* _q_replace */
/* ... This will be uncommented & replaced ... */
/* _q_end */
支持任何单行注释语法。
每个块中的注释应遵循相同的语法。例如,您不能混合使用// ...
和/* ... */
。
警告:这些指令已被弃用
_q_hide_from_users_begin
:已被_q_solution_begin
替换_q_hide_from_users_end
:已被_q_end
替换
替换规则:.nosolution
,.notest
当注释指令无法帮助时...
src/path/to/some/file.js
src/path/to/some/file.nosolution.js (`file.js` without solution)
src/path/to/some/file.js
src/path/to/some/file.notest.js (`file.js` without test)
警告:.initial
已被弃用,并由.nosolution
替换。
构建钩子:.qrun.py
.qrun.py
必须位于src
的根目录。每次导出时,qbuild
都会运行.qrun.py
。
传递给.qrun.py
的参数
--hide-solution
:如果传递,当前导出不应包含解决方案。--hide-test
:如果传递,当前导出不应包含测试。
只有当其他功能不足时才使用.qrun.py
。
项目详情
qbuild-0.3.7.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 170c39e1285a845ddf7238bf1a9423f1856490061795793bb33ae3ad38fb5aeb |
|
MD5 | 04d08191654e98272363d9d5b939ff63 |
|
BLAKE2b-256 | 536d769f95d907da3c9fdadbe5f520759d692147119aee661e4c033b405b191f |