Skip to content

Commit

Permalink
refactor: Rename openedx_events to openedx_hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
morenol committed Apr 15, 2021
1 parent 3b4f3de commit 248dde8
Show file tree
Hide file tree
Showing 21 changed files with 62 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[run]
branch = True
data_file = .coverage
source=openedx_events
source=openedx_hooks
omit =
tests
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Change Log
----------

..
All enhancements and patches to openedx_events will be documented
All enhancements and patches to openedx_hooks 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).
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ include CHANGELOG.rst
include LICENSE.txt
include README.rst
include requirements/base.in
recursive-include openedx_events *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg *.py
recursive-include openedx_hooks *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg *.py
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy

quality: ## check coding style with pycodestyle and pylint
touch tests/__init__.py
pylint openedx_events tests test_utils *.py
pylint openedx_hooks tests test_utils *.py
rm tests/__init__.py
pycodestyle openedx_events tests *.py
pydocstyle openedx_events tests *.py
isort --check-only --diff --recursive tests test_utils openedx_events *.py test_settings.py
pycodestyle openedx_hooks tests *.py
pydocstyle openedx_hooks tests *.py
isort --check-only --diff --recursive tests test_utils openedx_hooks *.py test_settings.py
python setup.py bdist_wheel
twine check dist/*
make selfcheck
Expand Down
49 changes: 19 additions & 30 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
openedx-events
openedx-hooks
=============================

|pypi-badge| |ci-badge| |codecov-badge| |doc-badge| |pyversions-badge|
|pypi-badge| |ci-badge| |codecov-badge| |pyversions-badge|
|license-badge|

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.
openedx-hooks is a python library that contains the common definitions (django signals) and utilities for the Open edX hooks framework.

What is this project?

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

The ``README.rst`` file should then provide an overview of the code in this
repository, including the main components and useful entry points for starting
to understand the code in more detail.

Documentation
-------------
Expand All @@ -31,19 +20,19 @@ One Time Setup
.. code-block::
# Clone the repository
git clone [email protected]:edx/openedx-events.git
cd openedx-events
git clone [email protected]:edx/openedx-hooks.git
cd openedx-hooks
# Set up a virtualenv using virtualenvwrapper with the same name as the repo and activate it
mkvirtualenv -p python3.8 openedx-events
mkvirtualenv -p python3.8 openedx-hooks
Every time you develop something in this repo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
# Activate the virtualenv
workon openedx-events
workon openedx-hooks
# Grab the latest code
git checkout master
Expand Down Expand Up @@ -113,26 +102,26 @@ For more information about these options, see the `Getting Help`_ page.
.. _community Slack workspace: https://openedx.slack.com/
.. _Getting Help: https://openedx.org/getting-help

.. |pypi-badge| image:: https://img.shields.io/pypi/v/openedx-events.svg
:target: https://pypi.python.org/pypi/openedx-events/
.. |pypi-badge| image:: https://img.shields.io/pypi/v/openedx-hooks.svg
:target: https://pypi.python.org/pypi/openedx-hooks/
:alt: PyPI

.. |ci-badge| image:: https://github.com/edx/openedx-events/workflows/Python%20CI/badge.svg?branch=master
:target: https://github.com/edx/openedx-events/actions
.. |ci-badge| image:: https://github.com/edunext/openedx-hooks/workflows/Python%20CI/badge.svg?branch=main
:target: https://github.com/edunext/openedx-hooks/actions
:alt: CI

.. |codecov-badge| image:: https://codecov.io/github/edx/openedx-events/coverage.svg?branch=master
:target: https://codecov.io/github/edx/openedx-events?branch=master
.. |codecov-badge| image:: https://codecov.io/github/edunext/openedx-hooks/coverage.svg?branch=master
:target: https://codecov.io/github/edunext/openedx-hooks?branch=main
:alt: Codecov

.. |doc-badge| image:: https://readthedocs.org/projects/openedx-events/badge/?version=latest
:target: https://openedx-events.readthedocs.io/en/latest/
.. |doc-badge| image:: https://readthedocs.org/projects/openedx-hooks/badge/?version=latest
:target: https://openedx-hooks.readthedocs.io/en/latest/
:alt: Documentation

.. |pyversions-badge| image:: https://img.shields.io/pypi/pyversions/openedx-events.svg
:target: https://pypi.python.org/pypi/openedx-events/
.. |pyversions-badge| image:: https://img.shields.io/pypi/pyversions/openedx-hooks.svg
:target: https://pypi.python.org/pypi/openedx-hooks/
:alt: Supported Python versions

.. |license-badge| image:: https://img.shields.io/github/license/edx/openedx-events.svg
:target: https://github.com/edx/openedx-events/blob/master/LICENSE.txt
.. |license-badge| image:: https://img.shields.io/github/license/edx/openedx-hooks.svg
:target: https://github.com/edunext/openedx-hooks/blob/main/LICENSE.txt
:alt: License
8 changes: 4 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/openedx-events.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/openedx-hooks.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/openedx-events.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/openedx-hooks.qhc"

.PHONY: applehelp
applehelp:
Expand All @@ -115,8 +115,8 @@ devhelp:
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/openedx-events"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/openedx-events"
@echo "# mkdir -p $$HOME/.local/share/devhelp/openedx-hooks"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/openedx-hooks"
@echo "# devhelp"

.PHONY: epub
Expand Down
16 changes: 8 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pylint: disable=invalid-name
"""
openedx-events documentation build configuration file.
openedx-hooks documentation build configuration file.
This file is execfile()d with the current directory set to its
containing dir.
Expand Down Expand Up @@ -40,7 +40,7 @@ def get_version(*file_paths):
REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(REPO_ROOT)

VERSION = get_version('../openedx_events', '__init__.py')
VERSION = get_version('../openedx_hooks', '__init__.py')


# If extensions (or modules to document with autodoc) are in another directory,
Expand Down Expand Up @@ -91,18 +91,18 @@ def get_version(*file_paths):
top_level_doc = 'index'

# General information about the project.
project = 'openedx-events'
project = 'openedx-hooks'
copyright = edx_theme.COPYRIGHT # pylint: disable=redefined-builtin
author = edx_theme.AUTHOR
project_title = 'openedx-events'
project_title = 'openedx-hooks'
documentation_title = "{project_title}".format(project_title=project_title)


# Set display_github to False if you don't want "edit on Github" button
html_context = {
"display_github": True, # Integrate GitHub
"github_user": "edx", # Username
"github_repo": 'openedx-events', # Repo name
"github_repo": 'openedx-hooks', # Repo name
"github_version": "master", # Version
"conf_py_path": "/docs/", # Path in the checkout to the docs root
}
Expand Down Expand Up @@ -188,7 +188,7 @@ def get_version(*file_paths):
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
# html_title = 'openedx-events v0.1.0'
# html_title = 'openedx-hooks v0.1.0'

# A shorter title for the navigation bar. Default is the same as html_title.
#
Expand Down Expand Up @@ -500,8 +500,8 @@ def on_init(app): # pylint: disable=unused-argument
# If we are, assemble the path manually
bin_path = os.path.abspath(os.path.join(sys.prefix, 'bin'))
apidoc_path = os.path.join(bin_path, apidoc_path)
check_call([apidoc_path, '-o', docs_path, os.path.join(root_path, 'openedx_events'),
os.path.join(root_path, 'openedx_events/migrations')])
check_call([apidoc_path, '-o', docs_path, os.path.join(root_path, 'openedx_hooks'),
os.path.join(root_path, 'openedx_hooks/migrations')])


def setup(app):
Expand Down
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.. openedx-events documentation top level file, created by
.. openedx-hooks documentation top level file, created by
sphinx-quickstart on Wed Apr 07 10:13:29 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
openedx-events
openedx-hookss
==============

What is this project?
Library with definitions and utilities for the Open edX hooks framework.

Contents:

Expand Down
4 changes: 2 additions & 2 deletions docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ if "%1" == "qthelp" (
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\openedx-events.qhcp
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\openedx-hooks.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\openedx-events.ghc
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\openedx-hooks.ghc
goto end
)

Expand Down
2 changes: 1 addition & 1 deletion docs/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Testing
=======

openedx-events has an assortment of test cases and code quality
openedx-hooks has an assortment of test cases and code quality
checks to catch potential problems during development. To run them all in the
version of Python you chose for your virtualenv:

Expand Down
2 changes: 1 addition & 1 deletion openedx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://open-edx-proposals.readthedocs.io/en/latest/oep-0002-bp-repo-metadata.html#specification

---
nick: openedx-events
nick: openedx-hooks
tags:
- tools
oeps:
Expand Down
5 changes: 0 additions & 5 deletions openedx_events/__init__.py

This file was deleted.

5 changes: 5 additions & 0 deletions openedx_hooks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
Hooks library for the openedx platform.
"""

__version__ = "0.1.0"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
openedx_events.signals.auth.v1 module.
openedx_hooks.signals.auth.v1 module.
"""

from django.dispatch import Signal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
openedx_events.signals.enrollment.v1 module.
openedx_hooks.signals.enrollment.v1 module.
"""

from django.dispatch import Signal
Expand Down
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
"""
Package metadata for openedx_events.
Package metadata for openedx_hooks.
"""
import os
import re
Expand Down Expand Up @@ -53,7 +53,7 @@ def is_requirement(line):
return line and not line.startswith(('-r', '#', '-e', 'git+', '-c'))


VERSION = get_version('openedx_events', '__init__.py')
VERSION = get_version('openedx_hooks', '__init__.py')

if sys.argv[-1] == 'tag':
print("Tagging the version on github:")
Expand All @@ -65,15 +65,15 @@ def is_requirement(line):
CHANGELOG = open(os.path.join(os.path.dirname(__file__), 'CHANGELOG.rst')).read()

setup(
name='openedx-events',
name='openedx-hooks',
version=VERSION,
description="""What is this project?""",
description="""Open edX hooks definitions and utilities.""",
long_description=README + '\n\n' + CHANGELOG,
author='edX',
author_email='[email protected]',
url='https://github.com/edx/openedx-events',
url='https://github.com/edx/openedx-hooks',
packages=[
'openedx_events',
'openedx_hooks',
],
include_package_data=True,
install_requires=load_requirements('requirements/base.in'),
Expand Down
4 changes: 2 additions & 2 deletions tests/test_openedx_events.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""
Tests for openedx_events.py.
Tests for openedx_hooks.py.
"""


class TestEvents:
"""
Tests of openedx events.
Tests of openedx hooks.
"""

def test_something(self):
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ignore = D101,D200,D203,D212,D215,D404,D405,D406,D407,D408,D409,D410,D411,D412,D


[pytest]
addopts = --cov openedx_events --cov-report term-missing --cov-report xml
addopts = --cov openedx_hooks --cov-report term-missing --cov-report xml
norecursedirs = .* docs requirements site-packages

[testenv]
Expand All @@ -51,7 +51,7 @@ deps =
-r{toxinidir}/requirements/doc.txt
commands =
doc8 --ignore-path docs/_build README.rst docs
rm -f docs/openedx_events.rst
rm -f docs/openedx_hooks.rst
rm -f docs/modules.rst
make -C docs clean
make -C docs html
Expand Down

0 comments on commit 248dde8

Please sign in to comment.