Commit Graph

909 Commits

Author SHA1 Message Date
Feanil Patel
25ecaa8f76 chore: Run package=sqlparse make upgrade-package 2024-05-06 14:44:13 -04:00
Kyle McCormick
4c0284b87d Revert "build: finish replacing paver assets (#34554)" (#34700)
Reverts #34554, which causes compilation of edX.org's
legacy comprehensive theme to be skipped in their deployment pipeline.
We have not determined the precise cause yet, but it seems like the
compile_sass management command is not correctly getting the
list of comprehensive theme directories from Django settings.
2024-05-06 12:57:51 -04:00
Kyle McCormick
3f0f7ce705 build: finish replacing paver assets (#34554)
Together, these changes make it so that all features of the Paver-based
asset compilation system are supported with drop-in Paver-free
replacements. The remaining Paver asset functions are trivial wrappers,
which can be comfortably deleted before Sumac.

* Turn `./manage.py ... compile_sass` into a simple wrapper around `npm
  run compile-sass`
* Turn `paver webpack` into a simple wrapper around `npm run webpack`
* Turn `pavelib.assets:collect_assets` into a simple wrapper around
  `./manage.py ... collectstatic`
* Add/improve deprecation warnings for all Paver asset commands.
* Load defaults for asset-related Django settings from environment
  variables. This allows the build to work without Python. For the
  settings which will be removed in Sumac, I've added deprecation
  warnings.
* Change EDX_PLATFORM_THEME_DIRS env var to COMPREHENSIVE_THEME_DIRS.
  This simplifies the migration instructions, because all the new env
  vars now match their corresponding Django settings. This amends an
  ADR, but it should not be a breaking change because the  env var was
  recently added (since Quince) and nobody should be using it yet.
* Future-proof the static assets ADR with links. The linked pages will
  be kept up-to-date even if the ADR isn't.

Part of: https://github.com/openedx/edx-platform/issues/34467
2024-05-06 08:29:45 -04:00
Feanil Patel
1d485ca2b8 build: Don't require the backports.zoneinfo package for newer python.
We do this so that we can build requirements files that could work to
`pip install` on both the old (3.8) and new (3.11) versions of python.
2024-05-01 10:03:42 -04:00
Usama Sadiq
188e486699 fix: fix lxml constraint issue (#34652)
* fix: pin lxml<5.0 version
* fix: update lxml constraint comment
---------
Co-authored-by: UsamaSadiq <UsamaSadiq@users.noreply.github.com>
2024-04-30 20:08:29 +05:00
Tim McCormack
afe93559b9 Revert "build: Python requirements upgrade and lxml build without binary (#34…" (#34661)
This reverts commit 52adce48d1 because we were getting this in the build pipeline:

```
WARNING: lxml 5.2.1 does not provide the extra 'html-clean'
ERROR: Exception:
Traceback (most recent call last):
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
    status = self.run(options, args)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 203, in wrapper
    return func(self, options, args)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 315, in run
    requirement_set = resolver.resolve(
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 94, in resolve
    result = self._result = resolver.resolve(
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 472, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 366, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 221, in _attempt_to_pin_criterion
    satisfied = all(
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 222, in <genexpr>
    self._p.is_satisfied_by(requirement=r, candidate=candidate)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 178, in is_satisfied_by
    return requirement.is_satisfied_by(candidate)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/requirements.py", line 84, in is_satisfied_by
    assert candidate.name == self.name, (
AssertionError: Internal issue: Candidate is not for this requirement lxml[html-clean,html-clean] vs lxml[html-clean]
WARNING: You are using pip version 21.2.1; however, version 24.0 is available.
You should consider upgrading via the '/edx/app/edxapp/venvs/edxapp/bin/python -m pip install --upgrade pip' command.
```
2024-04-29 21:06:45 +00:00
edX requirements bot
52adce48d1 build: Python requirements upgrade and lxml build without binary (#34655)
* build: build lxml without binary in requirements and CI workflows
---------
Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>
2024-04-29 23:48:57 +05:00
Usama Sadiq
734a5508ee fix: fix constraints path (#34638) 2024-04-26 21:15:51 +05:00
Usama Sadiq
9630d4080a build: use constraints in scripts requirements as well (#34635) 2024-04-26 16:17:40 +05:00
Usama Sadiq
7cf97ec0de fix: pin moto<5.0 (#34595) 2024-04-24 18:08:58 +05:00
Kyle D. McCormick
2cd3dc844d fix: NameErrors in compile_sass.py
Fixes three NameErrors which were introduced by the previous commit,
leading to it being reverted.

These NameErrors slipped through because the script was not tested on
any themes that had zero SCSS overrides.
2024-04-12 11:33:31 -04:00
Kyle D. McCormick
f57d412c71 revert: revert: build: remove dependency on Python sass module
This reverts commit a27cda2fd9.
2024-04-12 11:33:31 -04:00
Feanil Patel
dbce490906 chore: Update edx-rest-api-client to a python 3.11 compatible version. 2024-04-09 11:24:09 -04:00
Kyle McCormick
a27cda2fd9 revert: "build: remove dependency on Python sass module (#34439)" (#34476)
This reverts commit a08a10c396.

compile_sass.py had a bug which was caught by 2U's pipeline, but not
by local testing.
2024-04-05 11:59:58 -04:00
Kyle McCormick
a08a10c396 build: remove dependency on Python sass module (#34439)
Instead of using libsass-python's `sass` module, which is incompatible
with Python 3.11, we now directly use libsass-python's `_sass` module,
which directly binds to the underlying C++ libsass library.

This ensures that the Sass build will not a blocker for the edx-platform
Python 3.11 upgrade, which needs to land in Redwood.

For more details, see the docstring at scripts/compile_sass.py#L167
2024-04-05 10:50:05 -04:00
Kyle D. McCormick
bd82b1d75a docs: npm scripts for static assets are no longer experimental :) 2024-04-04 10:31:02 -04:00
Kyle D. McCormick
3b8d018e4b fix: simplify npm run watch-sass so that it is more reliable
The implementation of `npm run watch-sass` was trying really hard
to recompile precisely only the Sass that needed to be recompiled, but in
order to do so, it had to spin up several `watchmedo` processes
per theme. These processes would trigger one another sometimes, leading
to infinite recompilation loops.

Rather than figure out all the dependency directions and messing with
`watchmedo`, I've opted to simplify the script to invoke a single
`watchmedo` process per theme. A single theme recompiles within
seconds, so I think this is a good compromise, one which makes the
script easier to reason about will help me move pass this legacy
assets work.
2024-04-04 10:31:02 -04:00
Kyle McCormick
5a785482ab test: remove some unused paver references from CI scripts (#34468)
All CI used to go through scripts/generic-ci-tests.sh, which is a
wrapper around various `paver` test/linting/check invocations.
These days, most edx-platform CI checks just invoke their tools (pylint,
pycodestyle, pytest, etc.) directly.

In anticipation of the proposed Paver deprecation [1], let's remove
the parts of this script that aren't used any more, including several
`paver` command invocations. This should have no impact on CI.

Furthermore, we are able to remove the SHARD environment variable,
which was formely used to split unit and quality checks up into
smaller pieces. Unit tests and pylint checks now have their own
separate sharding logic, so there is only one "quality" shard remaining
(SHARD=4, ie generic quality checks), thus we don't need a SHARD
variable at all.

[1] https://github.com/openedx/edx-platform/issues/34467
2024-04-04 10:05:04 -04:00
Feanil Patel
aa8497f260 chore: Update edx-django-utils to a python 3.11 compatible version. 2024-04-01 13:42:52 -04:00
Muhammad Farhan Khan
7808913916 chore: Moved structures.py from tubular repository (#34328)
* chore: Moved structures.py from tubular repository
2024-03-12 09:46:34 -04:00
Muhammad Farhan Khan
65ea55c8aa Move user retirement scripts code from the tubular repo (#34063)
* refactor: Migragte user retirement scripts code from the tubular repo
2024-02-22 11:09:00 -05:00
edX requirements bot
255292a2c0 chore: Updating Python Requirements (#34258) 2024-02-20 16:14:17 +05:00
edX requirements bot
d2dc8cd0ac chore: Updating Python Requirements (#34183) 2024-02-06 18:23:44 +05:00
Pooja Kulkarni
f5b246d0e9 feat: copy/paste unit from within a unit in Studio - feature flagged (#33724)
(requires the contentstore.enable_copy_paste_units waffle flag)
2023-12-01 11:33:34 -08:00
edX requirements bot
b2cc7f8f7e chore: Updating Python Requirements (#33843)
Co-authored-by: Awais Qureshi <awais.qureshi@arbisoft.com>
2023-11-30 16:43:46 +05:00
edX requirements bot
c240fd8b52 Python Requirements Update (#33737)
* chore: Updating Python Requirements
* fix: fix test failure occurring due to faker upgrade
---------

Co-authored-by: UsamaSadiq <usama7274@gmail.com>
2023-11-17 23:56:24 +05:00
edX requirements bot
e46c1d1e61 Python Requirements Update (#33695)
* chore: Updating Python Requirements
* fix: fix completion test query count
---------

Co-authored-by: UsamaSadiq <usama7274@gmail.com>
2023-11-13 14:37:53 +05:00
Feanil Patel
66e987997c Revert "Revert "chore: remove bok-choy settings"" 2023-11-01 13:41:37 -04:00
Robert Raposa
083ccbf09b Revert "chore: remove bok-choy settings" 2023-10-31 15:27:44 -04:00
salman2013
9452cef97d chore: resolve conflicts 2023-10-23 12:05:25 +05:00
Kyle McCormick
c1163717df build: log npm run postinstall steps to STDOUT so they are visible in CI (#33142)
Without this change, `npm run postinstall` (aka
scripts/copy-node-modules.sh) uses `set -x`, which echo steps to STDERR.
By default, it seems that GitHub Actions doesn't show STDERR.

Having the steps visible in CI was very useful while debugging some
Tutor build improvements, so I figured it would be good to upstream the
change.
2023-10-04 17:34:16 +00:00
salman2013
936a6c0983 chore: resolve conflicts 2023-10-04 19:02:16 +05:00
salman2013
52860c5c9d chore: resolve conflicts 2023-10-04 18:45:02 +05:00
Zubair Shakoor
70f6f5ad9e fix: replaced mysql57 hosts with mysql80 (#33147) 2023-10-04 17:35:18 +05:00
edX requirements bot
9ddde642f8 chore: Updating Python Requirements (#33397) 2023-10-03 12:11:17 +05:00
edX requirements bot
b862bbeba6 chore: Updating Python Requirements (#33383) 2023-10-02 17:10:01 +05:00
salman2013
a763287152 chore: remove all reference for bok-choy 2023-09-28 16:05:15 +05:00
salman2013
42ca0ddec4 chore: remove bok choy settings 2023-09-27 10:58:37 +05:00
Adam Stankiewicz
32a1820360 chore: upgrade to edx-enterprise 4.2.0 (#33305) 2023-09-20 18:32:47 +00:00
Tim McCormack
0304a31c65 docs: Fix second link in sharding doc (#33286) 2023-09-20 16:00:28 +00:00
Tim McCormack
2d7f8afc2b docs: Fix link to sharding doc (#33278)
This should probably be turned into an ADR at some point, but for
now I've just recreated the page on the public wiki. (The space it
was in had been deleted during the 2U/Axim split.)
2023-09-19 12:54:36 +00:00
Syed Ali Abbas Zaidi
8480dbc228 chore: apply amnesty on existing not fixable issues (#32215)
* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint line around directives issue

* fix: eslint semi rule

* fix: eslint newline per chain rule

* fix: eslint space infix ops rule

* fix: eslint space-in-parens issue

* fix: eslint space before function paren issue

* fix: eslint space before blocks issue

* fix: eslint arrow body style issue

* fix: eslint dot-location issue

* fix: eslint quotes issue

* fix: eslint quote props issue

* fix: eslint operator assignment issue

* fix: eslint new line after import issue

* fix: indent issues

* fix: operator assignment issue

* fix: all autofixable eslint issues

* fix: all react related fixable issues

* fix: autofixable eslint issues

* chore: remove all template literals

* fix: remaining autofixable issues

* chore: apply amnesty on all existing issues

* fix: failing xss-lint issues

* refactor: apply amnesty on remaining issues

* refactor: apply amnesty on new issues

* fix: remove file level suppressions

* refactor: apply amnesty on new issues
2023-08-07 19:13:19 +05:00
Kyle McCormick
303bf5ef3c build: npm run watch (experimental) (#32866)
Implements the `npm run watch` section of the assets ADR [1], plus some
modifications since I decided to switch from pywatchman to watchdog (see
ADR changes for justification). This will replace `paver watch_assets`
(edx-platform) and `openedx-assets watch-themes` (Tutor).

Specifically, this PR adds three experimental commands:

* `npm run watch-sass` : Watch for Sass changes with watchdog.
* `npm run watch-webpack` : Invoke Webpack-watch for JS changes.
* `npm run watch` : Invoke both `watch-sass` and `watch-webpack` simultaneously.

These commands are only intended to work in development mode. They have
been tested both on bare-metal edx-platform and through `tutor dev run`
on on Linux.

Before removing the "experimental" label, we need to:

* Test through Devstack on Linux.
* Test through Devstack and `tutor dev run` on macOS.
* Test on bare-metal macOS. Might not work, which is OK, but we should
  document that.
* Document the commands in edx-platform's README.
* Confirm that this not only works through `tutor dev run`, but also as
  a suitable replacement in the `watchthemes` service that Tutor runs
  automatically as part of `tutor dev start`. Tweak if necessary.

References:

1. https://github.com/openedx/edx-platform/blob/master/docs/decisions/0017-reimplement-asset-processing.rst

Part of: https://github.com/openedx/edx-platform/issues/31612
2023-07-27 16:33:32 +00:00
Kyle McCormick
3e67719a24 build: npm run build (experimental) (#32823)
This PR implements much of the static assets rework ADR [1], including:

* `npm run build[-dev]`, and its subcommands,
* `npm run webpack[-dev]` and
* `npm run compile-sass[-dev]`.

This is backwards-compatible. `paver update_assets` should not be affected.
The new command warns that it is "experimental" for a few reasons:

* `npm run build` will fail in the webpack phase unless you first
run  `xmodule_assets`. This will be changed soon [2].

* We have tested the new build, but not quite so thoroughly that we'd
recommend it as the production default yet. Once the xmodule_assets
work lands, we'll share this on the forums so early adopters can try it
out.

* The commands lack some top-level documentation. Once they stabilize more,
we'll add a section to the README that explains how and when to use `npm run
build` and its subcommands and its env vars.

* `npm run watch` is not yet implemented.

References:
1. https://github.com/openedx/edx-platform/blob/master/docs/decisions/0017-reimplement-asset-processing.rst
2. https://github.com/openedx/edx-platform/pull/32685

Part of: https://github.com/openedx/edx-platform/issues/31604
2023-07-26 08:04:45 -04:00
edX requirements bot
a44c6d3d4a chore: Updating Python Requirements (#32829) 2023-07-25 12:48:44 +05:00
Kyle McCormick
a6f04d8ca3 build: copy from node_modules using NPM postinstall hook, not Paver (RE-MERGE)
Re-merge of 4b64d8342d

The commit after this one contains the fix for the issue that led to the
revert.
2023-07-20 13:46:21 -04:00
Kyle McCormick
95e0cdef28 Revert "build: copy from node_modules using NPM postinstall hook, not Paver (#32717)"
This reverts commit 4b64d8342d.
2023-07-17 14:06:05 -04:00
Kyle McCormick
4b64d8342d build: copy from node_modules using NPM postinstall hook, not Paver (#32717)
During the review of ADR 17 [1], Régis pointed out [2] that the shell script
which replaces Paver's `process_npm_assets`  could be automatically invoked as
an NPM post-install hook, ensuring that the step is seamlessly executed whenever
`npm install` is run. I had avoided using that suggestion, as I worried that it
would make it harder to move node_modules out of the edx-platform directory in
Tutor's openedx image.

Since then, two things have changed. Firstly, Tutor v16's new persistent mounts
interface [3] has lessened the importance of moving node_modules. Secondly, I
have realized that using a post-install hook would not preclude us from
modifying the underlying script (scripts/copy-node-modules.sh) to look in an
alternative location for node_modules, should that end up being something we
want to do.

This commit modifies the ADR based on those findings, stubs out Paver's
`process_npm_assets`, and adds the suggested post-install hook and replacement
Bash script.

References:
1. https://github.com/openedx/edx-platform/blob/master/docs/decisions/0017-reimplement-asset-processing.rst
2. https://github.com/openedx/edx-platform/pull/31790#discussion_r1122802492
3. https://github.com/overhangio/tutor/blob/master/CHANGELOG.md#v1600-2023-06-14

Part of: https://github.com/openedx/edx-platform/issues/31604
2023-07-17 13:26:58 -04:00
edX requirements bot
f2d30d9fbd chore: Updating Python Requirements (#32729) 2023-07-13 13:39:32 +05:00
Awais Qureshi
4bd032ab15 chore: adding pin to avoid test failures. (#32440)
* chore: adding pin to avoid test failures.
---------

Co-authored-by: edX requirements bot <49161187+edx-requirements-bot@users.noreply.github.com>
2023-06-14 12:44:39 +05:00