diff --git a/.gitignore b/.gitignore index 8e55cc443c..347fc4dfe6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ __pycache__ /build/ /dist/ /release_description.md + +# Copied at build-time +/tutor-openedx/tutoropenedx/__about__.py diff --git a/Makefile b/Makefile index ea4cfd5433..9ddd9c355c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .DEFAULT_GOAL := help .PHONY: docs -SRC_DIRS = ./tutor ./tests ./bin +SRC_DIRS = ./tutor ./tests ./bin ./tutor-openedx BLACK_OPTS = --exclude templates ${SRC_DIRS} ###### Development @@ -18,9 +18,14 @@ upgrade-requirements: ## Upgrade requirements files pip-compile --upgrade requirements/dev.in pip-compile --upgrade requirements/docs.in -build-pythonpackage: ## Build a python package ready to upload to pypi +build-pythonpackage: build-pythonpackage-tutor build-pythonpackage-tutor-openedx ## Build python packages ready to upload to pypi + +build-pythonpackage-tutor: ## Build the "tutor" python package for upload to pypi python setup.py sdist - python setup-obsolete.py sdist + +build-pythonpackage-tutor-openedx: ## Build the obsolete "tutor-openedx" python package for upload to pypi + cp tutor/__about__.py tutor-openedx/tutoropenedx/ + cd tutor-openedx && python setup.py sdist --dist-dir ../dist push-pythonpackage: ## Push python package to pypi twine upload --skip-existing dist/tutor-$(shell make version).tar.gz @@ -42,6 +47,7 @@ test-types: ## Check type definitions test-pythonpackage: build-pythonpackage ## Test that package can be uploaded to pypi twine check dist/tutor-$(shell make version).tar.gz + twine check dist/tutor-openedx-$(shell make version).tar.gz format: ## Format code automatically black $(BLACK_OPTS) diff --git a/tutor-openedx/MANIFEST.in b/tutor-openedx/MANIFEST.in new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tutor-openedx/README.rst b/tutor-openedx/README.rst new file mode 100644 index 0000000000..5d4014e197 --- /dev/null +++ b/tutor-openedx/README.rst @@ -0,0 +1,3 @@ +WARNING: This project has moved to https://pypi.org/project/tutor/. You should now install Tutor with:: + + pip install tutor diff --git a/setup-obsolete.py b/tutor-openedx/setup.py similarity index 86% rename from setup-obsolete.py rename to tutor-openedx/setup.py index bbfe844090..c9cf051df9 100644 --- a/setup-obsolete.py +++ b/tutor-openedx/setup.py @@ -1,24 +1,20 @@ 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 - """ + with io.open(os.path.join(HERE, "README.rst"), "rt", encoding="utf8") as f: + return f.read() def load_about(): about = {} with io.open( - os.path.join(HERE, "tutor", "__about__.py"), "rt", encoding="utf-8" + os.path.join(HERE, "tutoropenedx", "__about__.py"), "rt", encoding="utf-8" ) as f: exec(f.read(), about) # pylint: disable=exec-used return about @@ -42,7 +38,7 @@ def load_about(): description="The Docker-based Open edX distribution designed for peace of mind", long_description=load_readme(), long_description_content_type="text/x-rst", - packages=[], + packages=["tutoropenedx"], python_requires=">=3.5", install_requires=["tutor=={}".format(ABOUT["__version__"])], classifiers=[ @@ -59,8 +55,10 @@ def load_about(): "Programming Language :: Python :: 3.10", ], ) -sys.stderr.write(""" +sys.stderr.write( + """ Installing Tutor from tutor-openedx is deprecated. You should instead install the "tutor" package with: pip install tutor -""") +""" +) diff --git a/tutor-openedx/tutoropenedx/__init__.py b/tutor-openedx/tutoropenedx/__init__.py new file mode 100644 index 0000000000..e69de29bb2