From c15eec53dcf8196e86011483fc710777e9916db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Fri, 25 Jun 2021 17:03:43 +0200 Subject: [PATCH] feat: switch the package name from "tutor-openedx" to "tutor" The package maintainer of the "tutor" package was kind enough to transfer ownership of the project to us. This is great, because we no longer have to use the "openedx" suffix, which is trademarked. For the time being, we keep maintaining the "tutor-openedx" package which has a 1-to-1 dependency on the "tutor" package. In the future, we expect that we will no longer push upgrades to tutor-openedx. --- CHANGELOG.md | 4 +- Dockerfile | 2 +- Makefile | 4 +- .../{cli_download.rst => download/binary.rst} | 2 +- docs/download/pip.rst | 3 + docs/install.rst | 10 ++- docs/quickstart.rst | 6 +- setup-obsolete.py | 66 +++++++++++++++++++ setup.py | 4 +- 9 files changed, 88 insertions(+), 13 deletions(-) rename docs/{cli_download.rst => download/binary.rst} (82%) create mode 100644 docs/download/pip.rst create mode 100644 setup-obsolete.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bce92a..d15da52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,15 @@ Note: Breaking changes between versions are indicated by "💥". ## Unreleased +- [Improvement] Tutor is now published on pypi as "tutor". + ## v12.0.1 (2021-06-22) - [Bugfix] Fix double pulling mongodb image when upgrading from Koa to Lilac. - [Improvement] Better logging during `plugins disable`. - [Bugfix] Fix "upstream sent too big header" error during login of existing users after a Koa to Lilac upgrade. - [Feature] Added the ability to skip `config.yml` file modification while running `tutor config save` command with `-e` or `--env-only` flag. -- [Feature] Add new config value `FORUM_MONGODB_DATABASE` to set the forum database name +- [Feature] Add new config value `FORUM_MONGODB_DATABASE` to set the forum database name. ## v12.0.0 (2021-06-09) diff --git a/Dockerfile b/Dockerfile index 03a7cdd..a77d35e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ FROM docker.io/python:3.7-slim-stretch COPY --from=library/docker:19.03 /usr/local/bin/docker /usr/bin/docker COPY --from=docker/compose:1.24.0 /usr/local/bin/docker-compose /usr/bin/docker-compose -RUN pip install tutor-openedx +RUN pip install tutor RUN mkdir /opt/tutor ENV TUTOR_ROOT /opt/tutor diff --git a/Makefile b/Makefile index 7f7ec22..ea4cfd5 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,10 @@ upgrade-requirements: ## Upgrade requirements files build-pythonpackage: ## Build a python package ready to upload to pypi python setup.py sdist + python setup-obsolete.py sdist push-pythonpackage: ## Push python package to pypi + twine upload --skip-existing dist/tutor-$(shell make version).tar.gz twine upload --skip-existing dist/tutor-openedx-$(shell make version).tar.gz test: test-lint test-unit test-types test-format test-pythonpackage ## Run all tests by decreasing order or priority @@ -39,7 +41,7 @@ test-types: ## Check type definitions mypy --exclude=templates --ignore-missing-imports --strict tutor/ tests/ test-pythonpackage: build-pythonpackage ## Test that package can be uploaded to pypi - twine check dist/tutor-openedx-$(shell make version).tar.gz + twine check dist/tutor-$(shell make version).tar.gz format: ## Format code automatically black $(BLACK_OPTS) diff --git a/docs/cli_download.rst b/docs/download/binary.rst similarity index 82% rename from docs/cli_download.rst rename to docs/download/binary.rst index a71fd60..69c1c75 100644 --- a/docs/cli_download.rst +++ b/docs/download/binary.rst @@ -3,4 +3,4 @@ .. parsed-literal:: sudo curl -L "\ https\ ://github.com/overhangio/tutor/releases/download/v\ |tutor_version|/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor - sudo chmod 0755 /usr/local/bin/tutor + sudo chmod 0755 /usr/local/bin/tutor \ No newline at end of file diff --git a/docs/download/pip.rst b/docs/download/pip.rst new file mode 100644 index 0000000..6ddc32d --- /dev/null +++ b/docs/download/pip.rst @@ -0,0 +1,3 @@ +.. parsed-literal:: + + pip install tutor \ No newline at end of file diff --git a/docs/install.rst b/docs/install.rst index 648a638..5e14b9c 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -33,7 +33,7 @@ Direct binary download The latest binaries can be downloaded from https://github.com/overhangio/tutor/releases. From the command line: -.. include:: cli_download.rst +.. include:: download/binary.rst This is the simplest and recommended installation method for most people. Note however that you will not be able to use custom plugins with this pre-compiled binary. The only plugins you can use with this approach are those that are already bundled with the binary: see the :ref:`existing plugins `. @@ -42,16 +42,14 @@ This is the simplest and recommended installation method for most people. Note h Alternative installation methods -------------------------------- -If you would like to inspect the Tutor source code, you are most welcome to install Tutor from `Pypi `_ or directly from `the Github repository `_. You will need python >= 3.6 with pip and the libyaml development headers. On Ubuntu, these requirements can be installed by running:: +If you would like to inspect the Tutor source code, you are most welcome to install Tutor from `Pypi `_ or directly from `the Github repository `_. You will need python >= 3.6 with pip and the libyaml development headers. On Ubuntu, these requirements can be installed by running:: sudo apt install python3 python3-pip libyaml-dev Installing from pypi ~~~~~~~~~~~~~~~~~~~~ -:: - - pip install tutor-openedx +.. include:: download/pip.rst Installing from source ~~~~~~~~~~~~~~~~~~~~~~ @@ -129,7 +127,7 @@ Then, delete all data associated to your Open edX platform:: Finally, uninstall Tutor itself:: # If you installed tutor from source - pip uninstall tutor-openedx + pip uninstall tutor # If you downloaded the tutor binary sudo rm /usr/local/bin/tutor diff --git a/docs/quickstart.rst b/docs/quickstart.rst index fac29ac..d985001 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -5,7 +5,11 @@ Quickstart (1-click install) 1. `Download `_ the latest stable release of Tutor and place the ``tutor`` executable in your path. From the command line: -.. include:: cli_download.rst +.. include:: download/binary.rst + +Or: + +.. include:: download/pip.rst 2. Run ``tutor local quickstart`` 3. You're done! diff --git a/setup-obsolete.py b/setup-obsolete.py new file mode 100644 index 0000000..bbfe844 --- /dev/null +++ b/setup-obsolete.py @@ -0,0 +1,66 @@ +import io +import os +import sys + +from setuptools import setup + +HERE = os.path.abspath(os.path.dirname(__file__)) + + +def load_readme(): + return """ +WARNING: This project has moved to https://pypi.org/project/tutor/. You should now install Tutor with:: + + pip install tutor + """ + + +def load_about(): + about = {} + with io.open( + os.path.join(HERE, "tutor", "__about__.py"), "rt", encoding="utf-8" + ) as f: + exec(f.read(), about) # pylint: disable=exec-used + return about + + +ABOUT = load_about() + +setup( + name="tutor-openedx", + version=ABOUT["__version__"], + url="https://docs.tutor.overhang.io/", + project_urls={ + "Documentation": "https://docs.tutor.overhang.io/", + "Code": "https://github.com/overhangio/tutor", + "Issue tracker": "https://github.com/overhangio/tutor/issues", + "Community": "https://discuss.overhang.io", + }, + license="AGPLv3", + author="Overhang.io", + author_email="contact@overhang.io", + description="The Docker-based Open edX distribution designed for peace of mind", + long_description=load_readme(), + long_description_content_type="text/x-rst", + packages=[], + python_requires=">=3.5", + install_requires=["tutor=={}".format(ABOUT["__version__"])], + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Affero General Public License v3", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + ], +) +sys.stderr.write(""" +Installing Tutor from tutor-openedx is deprecated. You should instead install the "tutor" package with: + + pip install tutor +""") diff --git a/setup.py b/setup.py index c9a25aa..982c941 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ def is_requirement(line): ABOUT = load_about() setup( - name="tutor-openedx", + name="tutor", version=ABOUT["__version__"], url="https://docs.tutor.overhang.io/", project_urls={ @@ -47,7 +47,7 @@ setup( license="AGPLv3", author="Overhang.io", author_email="contact@overhang.io", - description="The docker-based Open edX distribution designed for peace of mind", + description="The Docker-based Open edX distribution designed for peace of mind", long_description=load_readme(), long_description_content_type="text/x-rst", packages=find_packages(exclude=["tests*"]),