Skip to content

Commit

Permalink
fix: Various (variables, metadata, versions, etc.)
Browse files Browse the repository at this point in the history
- Fix or remove ``tags`` repo metadata in several templates; remove deprecated ``nick`` from openedx.yaml (see OEP-2)
- Remove extraneous period after short description
- Move short description to top of readme
- Use project name, not repo name, for package name in setup.py
- Change Django documentation and setup.py references from 2.2 to 3.2
  • Loading branch information
timmc-edx authored Jul 11, 2022
1 parent ab52583 commit 7670bd0
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 26 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ Change Log
This file loosely adheres to the structure of https://keepachangelog.com/,
but in reStructuredText instead of Markdown.
2022-07-11
----------

Fixed
~~~~~

- Fix or remove ``tags`` repo metadata in several templates; remove deprecated ``nick`` from openedx.yaml (see OEP-2)
- Remove extraneous period after short description
- Move short description to top of readme
- Use project name, not repo name, for package name in setup.py
- Change Django documentation and setup.py references from 2.2 to 3.2

2022-07-05
----------

Expand Down
2 changes: 1 addition & 1 deletion cookiecutter-django-app/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"app_name": "{{ cookiecutter.repo_name.lower()|replace(' ', '_')|replace('-', '_')|replace('.', '_') }}",
"project_name": "{{ cookiecutter.repo_name }}",
"project_title": "{{ cookiecutter.project_name }}",
"project_short_description": "What is this project?",
"project_short_description": "One-line description for README and other doc files.",
"version": "0.1.0",
"author_name": "edX",
"author_email": "you@edx.org",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def get_version(*file_paths):
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'python': ('https://docs.python.org/3.8', None),
'django': ('https://docs.djangoproject.com/en/2.2/', 'https://docs.djangoproject.com/en/2.2/_objects/'),
'django': ('https://docs.djangoproject.com/en/3.2/', 'https://docs.djangoproject.com/en/3.2/_objects/'),
'model_utils': ('https://django-model-utils.readthedocs.io/en/latest/', None),
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
{{ cookiecutter.project_short_description }}.
{{ cookiecutter.project_short_description }}
"""

__version__ = '{{ cookiecutter.version }}'
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter-django-ida/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A cookiecutter_ template for edX Django projects.

This cookiecutter template is intended for new edX independently deployable apps (IDAs). It includes the following packages:

* Django 2.2
* Django 3.2
* Django REST Framework
* Django Waffle

Expand Down
2 changes: 1 addition & 1 deletion cookiecutter-django-ida/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"repo_name": "repo_name",
"project_name": "{{ cookiecutter.repo_name.lower()|replace(' ', '_')|replace('-', '_')|replace('.', '_')|trim() }}",
"project_short_description": "What is this project?",
"project_short_description": "One-line description for README and other doc files.",
"version": "0.1.0",
"author_name": "edX",
"author_email": "you@edx.org",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def root(*path_fragments):
WSGI_APPLICATION = '{{cookiecutter.project_name}}.wsgi.application'

# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
# Set this value in the environment-specific files (e.g. local.py, production.py, test.py)
DATABASES = {
'default': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{ cookiecutter.project_name }} URL Configuration.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from os.path import abspath, dirname
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter-python-library/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"repo_name": "repo_name",
"library_name": "{{ cookiecutter.repo_name.lower()|replace(' ', '_')|replace('-', '_')|replace('.', '_') }}",
"project_name": "{{ cookiecutter.repo_name }}",
"project_short_description": "What is this project?",
"project_short_description": "One-line description for README and other doc files.",
"version": "0.1.0",
"author_name": "edX",
"author_email": "you@edx.org",
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter-xblock/openedx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ oeps:
oep-2: true
oep-7: false
tags:
- backend-tooling
- xblock
6 changes: 3 additions & 3 deletions cookiecutter-xblock/{{cookiecutter.repo_name}}/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ These catalogs can be created by running::
The previous command will create the necessary ``.po`` files under
``{{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/locale/en/LC_MESSAGES/text.po``.
The ``text.po`` file is created from the ``django-partial.po`` file created by
``django-admin makemessages`` (`makemessages documentation <https://docs.djangoproject.com/en/2.2/topics/i18n/translation/#message-files>`_),
``django-admin makemessages`` (`makemessages documentation <https://docs.djangoproject.com/en/3.2/topics/i18n/translation/#message-files>`_),
this is why you will not see a ``django-partial.po`` file.

3. Create language specific translations
Expand Down Expand Up @@ -114,7 +114,7 @@ Once translations are in place, use the following Make target to compile the tra
$ make compile_translations

The previous command will compile ``.po`` files using
``django-admin compilemessages`` (`compilemessages documentation <https://docs.djangoproject.com/en/2.2/topics/i18n/translation/#compiling-message-files>`_).
``django-admin compilemessages`` (`compilemessages documentation <https://docs.djangoproject.com/en/3.2/topics/i18n/translation/#compiling-message-files>`_).
After compiling the ``.po`` file(s), ``django-statici18n`` is used to create language specific catalogs. See
``django-statici18n`` `documentation <https://django-statici18n.readthedocs.io/en/latest/>`_ for more information.

Expand Down Expand Up @@ -147,5 +147,5 @@ If there are any errors compiling ``.po`` files run the following command to val
$ make validate

See `django's i18n troubleshooting documentation
<https://docs.djangoproject.com/en/2.2/topics/i18n/translation/#troubleshooting-gettext-incorrectly-detects-python-format-in-strings-with-percent-signs>`_
<https://docs.djangoproject.com/en/3.2/topics/i18n/translation/#troubleshooting-gettext-incorrectly-detects-python-format-in-strings-with-percent-signs>`_
for more information.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
Django settings for {{cookiecutter.package_name}} project.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os

Expand All @@ -17,7 +17,7 @@
)

# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
# https://docs.djangoproject.com/en/3.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

Expand All @@ -31,7 +31,7 @@


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
# https://docs.djangoproject.com/en/3.2/howto/static-files/

STATIC_URL = '/static/'

Expand Down
1 change: 0 additions & 1 deletion openedx.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
nick: edx-cookiecutters
tags:
- tools
oeps:
Expand Down
2 changes: 1 addition & 1 deletion python-template/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"repo_name": "repo_name",
"sub_dir_name": "{{ cookiecutter.repo_name }}",
"project_name": "{{ cookiecutter.repo_name }}",
"project_short_description": "What is this project?",
"project_short_description": "One-line description for README and other doc files.",
"version": "0.1.0",
"author_name": "edX",
"author_email": "you@edx.org",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
|pypi-badge| |ci-badge| |codecov-badge| |doc-badge| |pyversions-badge|
|license-badge|

{{ cookiecutter.project_short_description}}

The ``README.rst`` file should start with a brief description of the repository,
which sets it in the context of other repositories under the ``edx``
organization. It should make clear where this fits in to the overall edX
codebase.

{{ cookiecutter.project_short_description}}

Overview (please modify)
------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# https://open-edx-proposals.readthedocs.io/en/latest/oep-0002-bp-repo-metadata.html#specification

---
nick: {{ cookiecutter.repo_name }}
tags:
- tools
oeps:
oep-2: true
oep-3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def package_data(pkg, roots):
CHANGELOG = open(os.path.join(os.path.dirname(__file__), 'CHANGELOG.rst'), encoding="utf8").read()

setup(
name='{{ cookiecutter.repo_name }}',
name='{{ cookiecutter.project_name }}',
version=VERSION,
description="""{{ cookiecutter.project_short_description }}""",
long_description=README + '\n\n' + CHANGELOG,
Expand All @@ -141,7 +141,7 @@ def package_data(pkg, roots):
'Development Status :: 3 - Alpha',
{%- if cookiecutter.requires_django == "yes" %}
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.2',
{%- endif %}
'Intended Audience :: Developers',
{%- if cookiecutter.open_source_license == "AGPL 3.0" %}
Expand Down

0 comments on commit 7670bd0

Please sign in to comment.