-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plus make upgrade make requirements to fill those in
- Loading branch information
Showing
58 changed files
with
3,423 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Change Log | ||
########## | ||
|
||
.. | ||
All enhancements and patches to ai_aside will be documented | ||
in this file. It adheres to the structure of https://keepachangelog.com/ , | ||
but in reStructuredText instead of Markdown (for ease of incorporation into | ||
Sphinx documentation and the PyPI description). | ||
This project adheres to Semantic Versioning (https://semver.org/). | ||
|
||
.. There should always be an "Unreleased" section for changes pending release. | ||
Unreleased | ||
********** | ||
|
||
* | ||
|
||
0.1.0 – 2023-05-10 | ||
********************************************** | ||
|
||
Added | ||
===== | ||
|
||
* First release on PyPI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include CHANGELOG.rst | ||
include LICENSE.txt | ||
include README.rst | ||
include requirements/base.in | ||
include requirements/constraints.txt | ||
recursive-include ai_aside *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
.PHONY: clean compile_translations coverage diff_cover docs dummy_translations \ | ||
extract_translations fake_translations help pii_check pull_translations push_translations \ | ||
quality requirements selfcheck test test-all upgrade validate install_transifex_client | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
# For opening files in a browser. Use like: $(BROWSER)relative/path/to/file.html | ||
BROWSER := python -m webbrowser file://$(CURDIR)/ | ||
|
||
help: ## display this help message | ||
@echo "Please use \`make <target>' where <target> is one of" | ||
@awk -F ':.*?## ' '/^[a-zA-Z]/ && NF==2 {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort | ||
|
||
clean: ## remove generated byte code, coverage reports, and build artifacts | ||
find . -name '__pycache__' -exec rm -rf {} + | ||
find . -name '*.pyc' -exec rm -f {} + | ||
find . -name '*.pyo' -exec rm -f {} + | ||
find . -name '*~' -exec rm -f {} + | ||
coverage erase | ||
rm -fr build/ | ||
rm -fr dist/ | ||
rm -fr *.egg-info | ||
|
||
coverage: clean ## generate and view HTML coverage report | ||
pytest --cov-report html | ||
$(BROWSER)htmlcov/index.html | ||
|
||
docs: ## generate Sphinx HTML documentation, including API docs | ||
tox -e docs | ||
$(BROWSER)docs/_build/html/index.html | ||
|
||
# Define PIP_COMPILE_OPTS=-v to get more information during make upgrade. | ||
PIP_COMPILE = pip-compile --upgrade $(PIP_COMPILE_OPTS) | ||
|
||
upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade | ||
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in | ||
pip install -qr requirements/pip-tools.txt | ||
# Make sure to compile files after any other files they include! | ||
$(PIP_COMPILE) --allow-unsafe -o requirements/pip.txt requirements/pip.in | ||
$(PIP_COMPILE) -o requirements/pip-tools.txt requirements/pip-tools.in | ||
pip install -qr requirements/pip.txt | ||
pip install -qr requirements/pip-tools.txt | ||
$(PIP_COMPILE) -o requirements/base.txt requirements/base.in | ||
$(PIP_COMPILE) -o requirements/test.txt requirements/test.in | ||
$(PIP_COMPILE) -o requirements/doc.txt requirements/doc.in | ||
$(PIP_COMPILE) -o requirements/quality.txt requirements/quality.in | ||
$(PIP_COMPILE) -o requirements/ci.txt requirements/ci.in | ||
$(PIP_COMPILE) -o requirements/dev.txt requirements/dev.in | ||
# Let tox control the Django version for tests | ||
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp | ||
mv requirements/test.tmp requirements/test.txt | ||
|
||
quality: ## check coding style with pycodestyle and pylint | ||
tox -e quality | ||
|
||
pii_check: ## check for PII annotations on all Django models | ||
tox -e pii_check | ||
|
||
piptools: ## install pinned version of pip-compile and pip-sync | ||
pip install -r requirements/pip.txt | ||
pip install -r requirements/pip-tools.txt | ||
|
||
requirements: piptools ## install development environment requirements | ||
pip-sync -q requirements/dev.txt requirements/private.* | ||
|
||
test: clean ## run tests in the current virtualenv | ||
pytest | ||
|
||
diff_cover: test ## find diff lines that need test coverage | ||
diff-cover coverage.xml | ||
|
||
test-all: quality pii_check ## run tests on every supported Python/Django combination | ||
tox | ||
tox -e docs | ||
|
||
validate: quality pii_check test ## run tests and quality checks | ||
|
||
selfcheck: ## check that the Makefile is well-formed | ||
@echo "The Makefile is well-formed." | ||
|
||
## Localization targets | ||
|
||
extract_translations: ## extract strings to be translated, outputting .mo files | ||
rm -rf docs/_build | ||
cd ai_aside && ../manage.py makemessages -l en -v1 -d django | ||
cd ai_aside && ../manage.py makemessages -l en -v1 -d djangojs | ||
|
||
compile_translations: ## compile translation files, outputting .po files for each supported language | ||
cd ai_aside && ../manage.py compilemessages | ||
|
||
detect_changed_source_translations: | ||
cd ai_aside && i18n_tool changed | ||
|
||
pull_translations: ## pull translations from Transifex | ||
tx pull -af -t --mode reviewed | ||
|
||
push_translations: ## push source translation files (.po) from Transifex | ||
tx push -s | ||
|
||
dummy_translations: ## generate dummy translation (.po) files | ||
cd ai_aside && i18n_tool dummy | ||
|
||
build_dummy_translations: extract_translations dummy_translations compile_translations ## generate and compile dummy translation files | ||
|
||
validate_translations: build_dummy_translations detect_changed_source_translations ## validate translations | ||
|
||
install_transifex_client: ## Install the Transifex client | ||
# Instaling client will skip CHANGELOG and LICENSE files from git changes | ||
# so remind the user to commit the change first before installing client. | ||
git diff -s --exit-code HEAD || { echo "Please commit changes first."; exit 1; } | ||
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash | ||
git checkout -- LICENSE README.md ## overwritten by Transifex installer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
ai-aside | ||
############################# | ||
|
||
.. note:: | ||
|
||
This README was auto-generated. Maintainer: please review its contents and | ||
update all relevant sections. Instructions to you are marked with | ||
"PLACEHOLDER" or "TODO". Update or remove those sections, and remove this | ||
note when you are done. | ||
|
||
|pypi-badge| |ci-badge| |codecov-badge| |doc-badge| |pyversions-badge| | ||
|license-badge| |status-badge| | ||
|
||
Purpose | ||
******* | ||
|
||
temporary readme filler | ||
|
||
TODO: The ``README.rst`` file should start with a brief description of the repository and its purpose. | ||
It should be described in the context of other repositories under the ``openedx`` | ||
organization. It should make clear where this fits in to the overall Open edX | ||
codebase and should be oriented towards people who are new to the Open edX | ||
project. | ||
|
||
Getting Started | ||
*************** | ||
|
||
Developing | ||
========== | ||
|
||
One Time Setup | ||
-------------- | ||
.. code-block:: | ||
# Clone the repository | ||
git clone [email protected]:openedx/ai-aside.git | ||
cd ai-aside | ||
# Set up a virtualenv using virtualenvwrapper with the same name as the repo and activate it | ||
mkvirtualenv -p python3.8 ai-aside | ||
Every time you develop something in this repo | ||
--------------------------------------------- | ||
.. code-block:: | ||
# Activate the virtualenv | ||
workon ai-aside | ||
# Grab the latest code | ||
git checkout main | ||
git pull | ||
# Install/update the dev requirements | ||
make requirements | ||
# Run the tests and quality checks (to verify the status before you make any changes) | ||
make validate | ||
# Make a new branch for your changes | ||
git checkout -b <your_github_username>/<short_description> | ||
# Using your favorite editor, edit the code to make your change. | ||
vim ... | ||
# Run your new tests | ||
pytest ./path/to/new/tests | ||
# Run all the tests and quality checks | ||
make validate | ||
# Commit all your changes | ||
git commit ... | ||
git push | ||
# Open a PR and ask for review. | ||
Deploying | ||
========= | ||
|
||
TODO: How can a new user go about deploying this component? Is it just a few | ||
commands? Is there a larger how-to that should be linked here? | ||
|
||
PLACEHOLDER: For details on how to deploy this component, see the `deployment how-to`_ | ||
|
||
.. _deployment how-to: https://docs.openedx.org/projects/ai-aside/how-tos/how-to-deploy-this-component.html | ||
|
||
Getting Help | ||
************ | ||
|
||
Documentation | ||
============= | ||
|
||
PLACEHOLDER: Start by going through `the documentation`_. If you need more help see below. | ||
|
||
.. _the documentation: https://docs.openedx.org/projects/ai-aside | ||
|
||
(TODO: `Set up documentation <https://openedx.atlassian.net/wiki/spaces/DOC/pages/21627535/Publish+Documentation+on+Read+the+Docs>`_) | ||
|
||
More Help | ||
========= | ||
|
||
If you're having trouble, we have discussion forums at | ||
https://discuss.openedx.org where you can connect with others in the | ||
community. | ||
|
||
Our real-time conversations are on Slack. You can request a `Slack | ||
invitation`_, then join our `community Slack workspace`_. | ||
|
||
For anything non-trivial, the best path is to open an issue in this | ||
repository with as many details about the issue you are facing as you | ||
can provide. | ||
|
||
https://github.com/openedx/ai-aside/issues | ||
|
||
For more information about these options, see the `Getting Help`_ page. | ||
|
||
.. _Slack invitation: https://openedx.org/slack | ||
.. _community Slack workspace: https://openedx.slack.com/ | ||
.. _Getting Help: https://openedx.org/getting-help | ||
|
||
License | ||
******* | ||
|
||
The code in this repository is licensed under the AGPL 3.0 unless | ||
otherwise noted. | ||
|
||
Please see `LICENSE.txt <LICENSE.txt>`_ for details. | ||
|
||
Contributing | ||
************ | ||
|
||
Contributions are very welcome. | ||
Please read `How To Contribute <https://openedx.org/r/how-to-contribute>`_ for details. | ||
|
||
This project is currently accepting all types of contributions, bug fixes, | ||
security fixes, maintenance work, or new features. However, please make sure | ||
to have a discussion about your new feature idea with the maintainers prior to | ||
beginning development to maximize the chances of your change being accepted. | ||
You can start a conversation by creating a new issue on this repo summarizing | ||
your idea. | ||
|
||
The Open edX Code of Conduct | ||
**************************** | ||
|
||
All community members are expected to follow the `Open edX Code of Conduct`_. | ||
|
||
.. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/ | ||
|
||
People | ||
****** | ||
|
||
The assigned maintainers for this component and other project details may be | ||
found in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml`` | ||
file in this repo. | ||
|
||
.. _Backstage: https://open-edx-backstage.herokuapp.com/catalog/default/component/ai-aside | ||
|
||
Reporting Security Issues | ||
************************* | ||
|
||
Please do not report security issues in public. Please email [email protected]. | ||
|
||
.. |pypi-badge| image:: https://img.shields.io/pypi/v/ai-aside.svg | ||
:target: https://pypi.python.org/pypi/ai-aside/ | ||
:alt: PyPI | ||
|
||
.. |ci-badge| image:: https://github.com/openedx/ai-aside/workflows/Python%20CI/badge.svg?branch=main | ||
:target: https://github.com/openedx/ai-aside/actions | ||
:alt: CI | ||
|
||
.. |codecov-badge| image:: https://codecov.io/github/openedx/ai-aside/coverage.svg?branch=main | ||
:target: https://codecov.io/github/openedx/ai-aside?branch=main | ||
:alt: Codecov | ||
|
||
.. |doc-badge| image:: https://readthedocs.org/projects/ai-aside/badge/?version=latest | ||
:target: https://docs.openedx.org/projects/ai-aside | ||
:alt: Documentation | ||
|
||
.. |pyversions-badge| image:: https://img.shields.io/pypi/pyversions/ai-aside.svg | ||
:target: https://pypi.python.org/pypi/ai-aside/ | ||
:alt: Supported Python versions | ||
|
||
.. |license-badge| image:: https://img.shields.io/github/license/openedx/ai-aside.svg | ||
:target: https://github.com/openedx/ai-aside/blob/main/LICENSE.txt | ||
:alt: License | ||
|
||
.. TODO: Choose one of the statuses below and remove the other status-badge lines. | ||
.. |status-badge| image:: https://img.shields.io/badge/Status-Experimental-yellow | ||
.. .. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen | ||
.. .. |status-badge| image:: https://img.shields.io/badge/Status-Deprecated-orange | ||
.. .. |status-badge| image:: https://img.shields.io/badge/Status-Unsupported-red |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
""" | ||
temporary readme filler | ||
""" | ||
|
||
__version__ = '0.1.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
ai_aside Django application initialization. | ||
""" | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class AiAsideConfig(AppConfig): | ||
""" | ||
Configuration for the ai_aside Django application. | ||
""" | ||
|
||
name = 'ai_aside' |
Oops, something went wrong.