diff --git a/cms/pytest.ini b/cms/pytest.ini index ee9263d63c..368ceb2570 100644 --- a/cms/pytest.ini +++ b/cms/pytest.ini @@ -1,6 +1,6 @@ [pytest] # Note: The first file of settings found is used, there is no combining, so -# this file is used for the tests in the cms tree, and setup.cfg is ignored. +# this file is used for the tests in the cms tree, and pyproject.toml is ignored. # Details at https://docs.pytest.org/en/latest/reference/customize.html DJANGO_SETTINGS_MODULE = cms.envs.test diff --git a/common/djangoapps/edxmako/README b/common/djangoapps/edxmako/README index 9896d78747..0367427698 100644 --- a/common/djangoapps/edxmako/README +++ b/common/djangoapps/edxmako/README @@ -19,5 +19,5 @@ Mako: http://www.makotemplates.org/ How to install? ================================================================================ - $ sudo python setup.py install + $ pip install . diff --git a/common/test/pytest.ini b/common/test/pytest.ini index d93a742172..29e51b489f 100644 --- a/common/test/pytest.ini +++ b/common/test/pytest.ini @@ -1,6 +1,6 @@ [pytest] # Note: The first file of settings found is used, there is no combining, so -# this file is used for the tests in the common/test tree, and setup.cfg is ignored. +# this file is used for the tests in the common/test tree, and pyproject.toml is ignored. # Details at https://docs.pytest.org/en/latest/reference/customize.html addopts = -p no:randomly --durations=20 --json-report --json-report-omit keywords streams collectors log traceback tests --json-report-file=none diff --git a/docs/concepts/extension_points.rst b/docs/concepts/extension_points.rst index 10024bd316..a8410fc6c4 100644 --- a/docs/concepts/extension_points.rst +++ b/docs/concepts/extension_points.rst @@ -87,7 +87,7 @@ If you wish to customize aspects of the learner or educator experiences, you'll Most python plugins are enabled using one of two methods: -1. A Python Entry point: the core Open edX platform provides a standard plugin loading mechanism in |edx_django_utils.plugins|_ which uses `stevedore`_ to find all installed python packages that declare a specific "entry point" in their setup.py file. See the ``entry_points`` defined in edx-platform's own ``setup.py`` for examples. +1. A Python Entry point: the core Open edX platform provides a standard plugin loading mechanism in |edx_django_utils.plugins|_ which uses `stevedore`_ to find all installed python packages that declare a specific "entry point" in their package configuration (typically ``pyproject.toml`` or ``setup.py``). See the ``entry_points`` defined in edx-platform's own ``pyproject.toml`` for examples. 2. A Django setting: Some plugins require modification of Django settings, which is typically done by editing ``/edx/etc/lms.yml`` (in Production) or ``edx-platform/lms/envs/private.py`` (on Devstack). .. |edx_django_utils.plugins| replace:: ``edx_django_utils.plugins`` diff --git a/lms/djangoapps/course_blocks/transformers/access_denied_filter.py b/lms/djangoapps/course_blocks/transformers/access_denied_filter.py index b4115dd755..8b6a531d51 100644 --- a/lms/djangoapps/course_blocks/transformers/access_denied_filter.py +++ b/lms/djangoapps/course_blocks/transformers/access_denied_filter.py @@ -18,8 +18,8 @@ class AccessDeniedMessageFilterTransformer(BlockStructureTransformer): @classmethod def name(cls): """ - Unique identifier for the transformer's class; - same identifier used in setup.py. + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. """ return "access_denied_message_filter" diff --git a/lms/djangoapps/course_blocks/transformers/hidden_content.py b/lms/djangoapps/course_blocks/transformers/hidden_content.py index e82d8d3441..80e602e6f2 100644 --- a/lms/djangoapps/course_blocks/transformers/hidden_content.py +++ b/lms/djangoapps/course_blocks/transformers/hidden_content.py @@ -39,8 +39,8 @@ class HiddenContentTransformer(BlockStructureTransformer): @classmethod def name(cls): """ - Unique identifier for the transformer's class; - same identifier used in setup.py. + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. """ return "hidden_content" diff --git a/lms/djangoapps/course_blocks/transformers/library_content.py b/lms/djangoapps/course_blocks/transformers/library_content.py index 10ef8c2138..e7f2258483 100644 --- a/lms/djangoapps/course_blocks/transformers/library_content.py +++ b/lms/djangoapps/course_blocks/transformers/library_content.py @@ -36,8 +36,8 @@ class ContentLibraryTransformer(FilteringTransformerMixin, BlockStructureTransfo @classmethod def name(cls): """ - Unique identifier for the transformer's class; - same identifier used in setup.py. + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. """ return "library_content" @@ -197,8 +197,8 @@ class ContentLibraryOrderTransformer(BlockStructureTransformer): @classmethod def name(cls): """ - Unique identifier for the transformer's class; - same identifier used in setup.py + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. """ return "library_content_randomize" diff --git a/lms/djangoapps/course_blocks/transformers/load_override_data.py b/lms/djangoapps/course_blocks/transformers/load_override_data.py index 672922ea51..7f57768b50 100644 --- a/lms/djangoapps/course_blocks/transformers/load_override_data.py +++ b/lms/djangoapps/course_blocks/transformers/load_override_data.py @@ -67,8 +67,8 @@ class OverrideDataTransformer(BlockStructureTransformer): @classmethod def name(cls): """ - Unique identifier for the transformer's class; - same identifier used in setup.py. + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. """ return "load_override_data" diff --git a/lms/djangoapps/course_blocks/transformers/split_test.py b/lms/djangoapps/course_blocks/transformers/split_test.py index 4de70d8bad..45fdaa0981 100644 --- a/lms/djangoapps/course_blocks/transformers/split_test.py +++ b/lms/djangoapps/course_blocks/transformers/split_test.py @@ -30,8 +30,8 @@ class SplitTestTransformer(FilteringTransformerMixin, BlockStructureTransformer) @classmethod def name(cls): """ - Unique identifier for the transformer's class; - same identifier used in setup.py. + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. """ return "split_test" diff --git a/lms/djangoapps/course_blocks/transformers/start_date.py b/lms/djangoapps/course_blocks/transformers/start_date.py index 13ba3b7470..0d7165034e 100644 --- a/lms/djangoapps/course_blocks/transformers/start_date.py +++ b/lms/djangoapps/course_blocks/transformers/start_date.py @@ -39,8 +39,8 @@ class StartDateTransformer(FilteringTransformerMixin, BlockStructureTransformer) @classmethod def name(cls): """ - Unique identifier for the transformer's class; - same identifier used in setup.py. + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. """ return "start_date" diff --git a/lms/djangoapps/course_blocks/transformers/user_partitions.py b/lms/djangoapps/course_blocks/transformers/user_partitions.py index 087c6e5fc7..54424eb06f 100644 --- a/lms/djangoapps/course_blocks/transformers/user_partitions.py +++ b/lms/djangoapps/course_blocks/transformers/user_partitions.py @@ -32,8 +32,8 @@ class UserPartitionTransformer(BlockStructureTransformer): @classmethod def name(cls): """ - Unique identifier for the transformer's class; - same identifier used in setup.py. + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. """ return "user_partitions" diff --git a/lms/djangoapps/course_blocks/transformers/visibility.py b/lms/djangoapps/course_blocks/transformers/visibility.py index 19b0d2252d..f7dd0da5f0 100644 --- a/lms/djangoapps/course_blocks/transformers/visibility.py +++ b/lms/djangoapps/course_blocks/transformers/visibility.py @@ -32,8 +32,8 @@ class VisibilityTransformer(FilteringTransformerMixin, BlockStructureTransformer @classmethod def name(cls): """ - Unique identifier for the transformer's class; - same identifier used in setup.py. + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. """ return "visibility" diff --git a/lms/djangoapps/courseware/transformers.py b/lms/djangoapps/courseware/transformers.py index 2577a9c423..f2bba80c2b 100644 --- a/lms/djangoapps/courseware/transformers.py +++ b/lms/djangoapps/courseware/transformers.py @@ -18,8 +18,8 @@ class OpenAssessmentDateTransformer(FilteringTransformerMixin, BlockStructureTra @classmethod def name(cls): """ - Unique identifier for the transformer's class; - same identifier used in setup.py. + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. """ return 'open_assessment_transformer' diff --git a/lms/djangoapps/grades/transformer.py b/lms/djangoapps/grades/transformer.py index 38fe903ba7..f322ea0162 100644 --- a/lms/djangoapps/grades/transformer.py +++ b/lms/djangoapps/grades/transformer.py @@ -55,8 +55,8 @@ class GradesTransformer(BlockStructureTransformer): @classmethod def name(cls): """ - Unique identifier for the transformer's class; - same identifier used in setup.py. + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. """ return 'grades' diff --git a/openedx/core/djangoapps/content/block_structure/__init__.py b/openedx/core/djangoapps/content/block_structure/__init__.py index 00ed1b12d2..cf345b73cf 100644 --- a/openedx/core/djangoapps/content/block_structure/__init__.py +++ b/openedx/core/djangoapps/content/block_structure/__init__.py @@ -49,7 +49,7 @@ Transformers. Registry. Transformers are registered using the platform's PluginManager (e.g., Stevedore). This is currently done by updating -setup.py. Only registered transformers are called during the Collect +pyproject.toml. Only registered transformers are called during the Collect Phase. And only registered transformers can be used during the Transform phase. Exceptions to this rule are any nested transformers that are contained within higher-order transformers - as long as the diff --git a/openedx/core/djangoapps/content/block_structure/transformer.py b/openedx/core/djangoapps/content/block_structure/transformer.py index 1bcde62e06..b2ac620dc9 100644 --- a/openedx/core/djangoapps/content/block_structure/transformer.py +++ b/openedx/core/djangoapps/content/block_structure/transformer.py @@ -65,7 +65,7 @@ class BlockStructureTransformer: identify the transformer's cached data. So it should be unique and not conflict with other transformers. Consider using the same name that is used in the Transformer Registry. For example, - for Stevedore, it is specified in the setup.py file. + for Stevedore, it is specified in the package configuration (pyproject.toml). Once the transformer is in use and its data is cached, do not modify this name value without consideration of backward diff --git a/openedx/core/djangoapps/course_apps/docs/decisions/001-course-apps.rst b/openedx/core/djangoapps/course_apps/docs/decisions/001-course-apps.rst index 4491779a27..cccd0eba87 100644 --- a/openedx/core/djangoapps/course_apps/docs/decisions/001-course-apps.rst +++ b/openedx/core/djangoapps/course_apps/docs/decisions/001-course-apps.rst @@ -105,14 +105,14 @@ check. Course App Plugin Class ======================= -To be loaded as a Course App, you need to provide an entrypoint in ``setup.py`` +To be loaded as a Course App, you need to provide an entrypoint in ``pyproject.toml`` with the namespace ``openedx.course_app``. The entry should point to a Python class with the following basic structure: .. code-block:: python class CourseApp: - # The app id should match what is specified in the setup.py entrypoint + # The app id should match what is specified in the pyproject.toml entrypoint app_id: str = 'wiki' name: str = 'Wiki' description: str = 'A short description of what the Wiki does.' diff --git a/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py b/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py index 73f824d9fa..1b6a4bdb18 100644 --- a/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py +++ b/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py @@ -254,7 +254,7 @@ class TestCohortPartitionScheme(ModuleStoreTestCase): class TestExtension(django.test.TestCase): """ Ensure that the scheme extension is correctly plugged in (via entry point - in setup.py) + in pyproject.toml) """ def test_get_scheme(self): diff --git a/openedx/core/djangoapps/course_live/docs/decisions/001-course-live.rst b/openedx/core/djangoapps/course_live/docs/decisions/001-course-live.rst index 27ee3b4884..9fbed126c6 100644 --- a/openedx/core/djangoapps/course_live/docs/decisions/001-course-live.rst +++ b/openedx/core/djangoapps/course_live/docs/decisions/001-course-live.rst @@ -29,10 +29,10 @@ Decision We proposed to add the course live as a plugin with the following structure Course Live App Plugin Class ------------------------ +---------------------------- -The app will be loaded as a plugin and added to `setup.py` with the namespace -"openedx.course_app". +The app will be loaded as a plugin and added to ``pyproject.toml`` with the namespace +``openedx.course_app``. .. code-block :: python diff --git a/openedx/core/djangoapps/discussions/transformers.py b/openedx/core/djangoapps/discussions/transformers.py index 8fcf78bc1f..a4d34434ab 100644 --- a/openedx/core/djangoapps/discussions/transformers.py +++ b/openedx/core/djangoapps/discussions/transformers.py @@ -19,8 +19,8 @@ class DiscussionsTopicLinkTransformer(BlockStructureTransformer): @classmethod def name(cls): """ - Unique identifier for the transformer's class; - same identifier used in setup.py. + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. """ return "discussions_link" diff --git a/openedx/core/djangoapps/user_api/tests/test_partition_schemes.py b/openedx/core/djangoapps/user_api/tests/test_partition_schemes.py index b1fc0e6e57..afa6ab7939 100644 --- a/openedx/core/djangoapps/user_api/tests/test_partition_schemes.py +++ b/openedx/core/djangoapps/user_api/tests/test_partition_schemes.py @@ -141,7 +141,7 @@ class TestRandomUserPartitionScheme(PartitionTestCase): class TestExtension(TestCase): """ Ensure that the scheme extension is correctly plugged in (via entry point - in setup.py) + in pyproject.toml) """ def test_get_scheme(self): diff --git a/openedx/core/djangoapps/verified_track_content/tests/test_partition_scheme.py b/openedx/core/djangoapps/verified_track_content/tests/test_partition_scheme.py index f7de6042ef..b30eea70d4 100644 --- a/openedx/core/djangoapps/verified_track_content/tests/test_partition_scheme.py +++ b/openedx/core/djangoapps/verified_track_content/tests/test_partition_scheme.py @@ -94,7 +94,7 @@ class EnrollmentTrackPartitionSchemeTest(SharedModuleStoreTestCase): def test_get_scheme(self): """ - Ensure that the scheme extension is correctly plugged in (via entry point in setup.py) + Ensure that the scheme extension is correctly plugged in (via entry point in pyproject.toml) """ assert UserPartition.get_scheme('enrollment_track') == EnrollmentTrackPartitionScheme diff --git a/openedx/core/lib/xblock_pipeline/finder.py b/openedx/core/lib/xblock_pipeline/finder.py index a87b564afc..6c6791f708 100644 --- a/openedx/core/lib/xblock_pipeline/finder.py +++ b/openedx/core/lib/xblock_pipeline/finder.py @@ -123,7 +123,7 @@ class XBlockPipelineFinder(BaseFinder): # lint-amnesty, pylint: disable=abstrac # xblock_resource_info holds (package_name, resources_dir) tuples. While # it never happens in practice, the XBlock API does allow different - # XBlocks installed with the same setup.py to refer to their shared + # XBlocks installed from the same package to refer to their shared # static assets using different prefixes. xblock_resource_info = { (xblock_resource_pkg(xblock_class), xblock_class.get_resources_dir()) diff --git a/openedx/features/content_type_gating/block_transformers.py b/openedx/features/content_type_gating/block_transformers.py index 94b66eda43..b374e3ff51 100644 --- a/openedx/features/content_type_gating/block_transformers.py +++ b/openedx/features/content_type_gating/block_transformers.py @@ -25,8 +25,8 @@ class ContentTypeGateTransformer(BlockStructureTransformer): @classmethod def name(cls): """ - Unique identifier for the transformer's class; - same identifier used in setup.py. + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. """ return "content_type_gate" diff --git a/openedx/features/effort_estimation/block_transformers.py b/openedx/features/effort_estimation/block_transformers.py index d315aefd06..c3e6bce1f8 100644 --- a/openedx/features/effort_estimation/block_transformers.py +++ b/openedx/features/effort_estimation/block_transformers.py @@ -53,7 +53,10 @@ class EffortEstimationTransformer(BlockStructureTransformer): @classmethod def name(cls): - """Unique identifier for the transformer's class; same identifier used in setup.py.""" + """ + Unique identifier for the transformer's class. + This must match the entry point name in the package configuration. + """ return 'effort_estimation' @classmethod diff --git a/openedx/tests/xblock_integration/test_external_xblocks.py b/openedx/tests/xblock_integration/test_external_xblocks.py index 01bdf2133c..dbeba088fa 100644 --- a/openedx/tests/xblock_integration/test_external_xblocks.py +++ b/openedx/tests/xblock_integration/test_external_xblocks.py @@ -29,9 +29,9 @@ class InvalidTestName(Exception): ''' This means you have an entry point for a test that does not correspond to a properly named test class. For example, if you cut-and-paste entry - points in `setup.py`, and forgot to repoint the class (so it points to - `DoneXBlock` instead of `TestDone`), or otherwise made an error, you - will see this exception. + points in your package configuration, and forgot to repoint the class + (so it points to `DoneXBlock` instead of `TestDone`), or otherwise made + an error, you will see this exception. ''' pass # lint-amnesty, pylint: disable=unnecessary-pass diff --git a/requirements/edx/github.in b/requirements/edx/github.in index 3c01759768..7fdb2c051c 100644 --- a/requirements/edx/github.in +++ b/requirements/edx/github.in @@ -57,19 +57,21 @@ # # * DIST-NAME is the distribution name, the same name you'd use in a # "pip install" command. It might be different than REPO-NAME. It must -# be the same as the `name="DIST-NAME"` value in the repo's setup.py. +# be the same as the package name defined in the repo's pyproject.toml +# (or setup.py for older packages). # # * VERSION might not be the same as TAG-OR-SHA, but if the tag names the # version, please make it match the VERSION, but with a "v" prefix. -# VERSION must be the same as the `version="VERSION"` value in the repo's -# setup.py. An alternative is to use 0.0 as VERSION: this forces pip to -# re-install the package each time, and can be useful when working with two -# repos before picking a version number. Don't use 0.0 on master, only for -# tight-loop work in progress. +# VERSION must be the same as the version defined in the repo's pyproject.toml +# (or setup.py for older packages). An alternative is to use 0.0 as VERSION: +# this forces pip to re-install the package each time, and can be useful when +# working with two repos before picking a version number. Don't use 0.0 on +# master, only for tight-loop work in progress. # # * Don't prefix the URL with "-e". That would install the package in "editable" -# mode A.K.A "development" mode, which takes longer and does not -# fully respect setup.py, making the transition back to PyPI more complex. +# mode A.K.A "development" mode, which takes longer and does not fully respect +# the package's build configuration, making the transition back to PyPI more +# complex. # # * Organize the URL into one of the two categories below: diff --git a/tox.ini b/tox.ini index e5df7f0fbd..c129fb8cf0 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = py{311} quality # This is needed to prevent the lms, cms, and openedx packages inside the "Open -# edX" package (defined in setup.py) from getting installed into site-packages +# edX" package (defined in pyproject.toml) from getting installed into site-packages # where they can get imported, which is bad because those won't even contain # most of the source code since we don't explicitly add anything to the source # distribution. diff --git a/xmodule/partitions/partitions.py b/xmodule/partitions/partitions.py index 9a9d637d31..1ab152f81c 100644 --- a/xmodule/partitions/partitions.py +++ b/xmodule/partitions/partitions.py @@ -17,7 +17,7 @@ from stevedore.extension import ExtensionManager # * 1 -> 49: Unused/Reserved # * 50: The enrollment track partition # * 51: The content type gating partition (defined elsewhere) -# * 52-99: Available for other single user partitions, plugged in via setup.py. +# * 52-99: Available for other single user partitions, plugged in via entry points. # Operators, beware of conflicting IDs between plugins! # * 100 -> 2^31-1: General namespace for generating IDs at runtime. # This includes, at least: content partitions, the cohort partition, and teamset partitions.