-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: FC-0012 - add atlas support for cookiecutter-xblock #382
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
{ | ||
"project_desc": "My First XBlock", | ||
"package_name": "myxblock", | ||
"package_name": "my_xblock", | ||
"i18n_namespace": "{{cookiecutter.package_name.split('_')|map('capitalize')|join('')}}I18n", | ||
"github_org": "openedx", | ||
"repo_name": "{{cookiecutter.package_name}}-xblock", | ||
"tag_name": "myxblock", | ||
"repo_name": "{{cookiecutter.package_name.replace('_', '-')}}", | ||
"tag_name": "{{cookiecutter.package_name|lower}}", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar to the comment about is this intentional? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
"version": "0.1.0", | ||
"class_name": "MyXBlock", | ||
"author_name": "Open edX Project", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
""" | ||
Verify that project info is valid. | ||
""" | ||
import sys | ||
|
||
if '{{ cookiecutter.package_name }}' == 'xblock': # pylint: disable=comparison-of-constants | ||
print('ERROR: xblock is not a valid Python module name!') | ||
sys.exit(1) | ||
|
||
if '{{ cookiecutter.i18n_namespace }}' == '{{ cookiecutter.package_name }}': # pylint: disable=comparison-of-constants | ||
print('ERROR: (i18n_namespace) cannot be the same as (package_name)!') | ||
sys.exit(1) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,15 +81,16 @@ def test_readme(options_baked, custom_template): | |
def test_manifest(options_baked): | ||
"""The generated MANIFEST.in should pass a sanity check.""" | ||
manifest_text = Path("MANIFEST.in").read_text() | ||
assert 'recursive-include myxblock *.html' in manifest_text | ||
assert 'recursive-include my_xblock *.html' in manifest_text | ||
|
||
|
||
def test_setup_py(options_baked): | ||
"""The generated setup.py should pass a sanity check.""" | ||
setup_text = Path("setup.py").read_text() | ||
assert "VERSION = get_version('myxblock', '__init__.py')" in setup_text | ||
assert "VERSION = get_version('my_xblock', '__init__.py')" in setup_text | ||
assert " author='Cookie Monster'," in setup_text | ||
assert " author_email='[email protected]'," in setup_text | ||
assert " 'my_xblock = my_xblock:MyXBlock'," in setup_text | ||
|
||
|
||
def test_quality(options_baked): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is changing behavior
before this change, the value of
repo_name
would bemyxblock-xblock
, now it'smy-xblock
is this change intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is intentional, I see it as more convenient to have the repo name the same as the package name unless the creator decides otherwise. No technical reason or implication for that
Note: the template will not enforce anything. It'll just propose these as defaults, and the XBlock creator can change them on the spot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another thing is that we have a new field
i18n_namespace
that will look nicer by this change