Commit Graph

112 Commits

Author SHA1 Message Date
Kyle D. McCormick
e64becbdf0 test: fix remaining paver tests
They haven't been run in CI in years, and had gradually become broken
2024-05-21 15:14:38 -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
825503a750 fix: Remove call to print_devstack_warnings
This is the only call to the removed function and the removed function
printed a dead link about an issue that may no longer be relevant so
we're just removing this call rather than putting the message back.
2023-11-01 13:45:44 -04: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
2a4ce5fa48 chore: fix comments, remove un-used variable 2023-10-12 20:11:25 +05:00
Tim McCormack
e0cee84ca9 fix: Bust node prereq cache on changes to package-lock.json as well
We're using `npm ci`, so the package-lock file is actually the more
important file to check for changes.
2023-08-09 14:12:21 -04:00
Tim McCormack
9f19fa55fe fix: Delete root-owned files when provisioning
This should help avoid permissions errors for existing devstack users when
they re-provision.

Ticket: https://github.com/openedx/devstack/issues/1138
2023-08-09 14:12:21 -04:00
Tim McCormack
437418d367 feat: Switch Dockerfile from npm install to npm ci; some cleanup (#32590)
Otherwise we're not really respecting the package-lock file and won't get
repeatable results.

Also:

- Clean up old error handling for npm<3. Were on npm 8 now. Probably
  can get rid of this.
- Use the shorthand `npm ci` rather than `npm clean-install` just for
  consistency with code elsewhere.
- Update comments in tests to be explicit about use of ci rather than
  install
2023-06-29 21:55:23 +00:00
Tim McCormack
b8a34f0c57 build: Set Django version for tests more safely; drop support for non-GHA (#31387)
We have a need to lock the version of Django for production and tests, but
also to test on newer versions of Django so that we can get the repo ready
for long-term-support releases.

We've been doing that by extracting the `django==x.y.z` from the
pip-compiled files and moving it to a django.txt that is then co-installed
but can be overridden during tests. The problem is that this can result
in broken packages.

The approach here is to have `make test-requirements` continue to
ensure a consistent set of packages, and then install a different
Django on top of that in the CI script -- and call `pip check` to make
sure that combination isn't broken.

Adding Django 4.0 to the unit-tests.yml matrix will now correctly
result in this error and a failing job:
`django-splash 1.2.1 has requirement Django<4.0, but you have django 4.0.8.`

The other half of this is to change other CI runners to remove their
ability to control the Django version, since it's complicated to make
this work, and we probably only need it in unit-tests.yml. Convert them
to just use `make test-requirements`.

Also:

- Simplify handling of `pip --src` by setting `PIP_SRC` (rather than our
  own `PIP_SRC_DIR`, which pip ignores because `--src-dir` isn't an option
  that it knows). This is needed to allow `make test-requirements` to do
  the pip calls. An alternative would be to set a pip-options env var for
  the make target to use, but `PIP_SRC` already exists.
- Remove outdated modifications to common_constraints
- Add comment explaining why pylint tests need dev-requirements
2022-12-12 21:45:15 +00:00
UsamaSadiq
897cb3617f refactor!: delete common/lib and related usages 2022-09-22 14:16:34 +05:00
Sarina Canelake
4a2f231302 fix: fix github url strings (org edx -> openedx) 2022-09-15 14:52:28 -04:00
Kyle McCormick
bacce909f6 build: in CI, use npm clean-install instead of npm install
Packages can be added to package-lock.json that will fail to
install on certain systems. For example, the `fsevents` NPM
package, which only works on macOS, was listed as a requirement
in the file.

`npm install` will happily skip over such packages.
`npm clean-install`, however, will exit with a fatal error.

Throughout several doc pages, we have recently been encouraging
folks to use `clean-install` instead of `install`, because its
strictness makes it more reproducible. To ensure that `clean-install`
is working reliably at any given time, we should use `clean-install`
in our CI pipeline.
2022-09-13 15:26:54 -04:00
Awais Qureshi
b97af6ac6e build: Removing un-used django versions from tox and other places. (#30270) 2022-04-19 16:41:29 +05:00
Muhammad Soban Javed
e2dc24af3a fix: update quality checks for django 3.2 (#28958) 2021-10-06 23:44:48 +05:00
M. Zulqarnain
8142e631fc build: Quality on GH Actions (#28561) 2021-09-22 13:24:18 +05:00
Usama Sadiq
4f4be6538a BOM-2477: pylint warnings lint-amnesty (#27585) 2021-05-11 17:22:40 +05:00
Jawayria
96e1bffc97 Refactor: Removed unused imports
Removed unused imports from docs, scripts, pavelib
2021-04-09 16:03:53 +05:00
M. Zulqarnain
e35d3de376 refactor: pyupgrade on docs & pavelib (#26768) 2021-03-05 15:24:59 +05:00
Ned Batchelder
981ecb675e build: private.txt files weren't handled properly
The requirements/edx/private.txt file is for dev's own private package
needs.  There are two installation mechanisms in edx-platform, and
neither handled the file properly:

- `paver install_prereqs` had the wrong file name.  The file was moved
  almost three years ago, and paver wasn't kept up.

- `make requirements` used `private.*` which included private.in, which
  pip-sync balks at.
2021-02-26 22:19:47 -05:00
Jawayria
69e0dc7d68 Applied pylint-amnesty to {docs, import_shims, pavelib} 2021-02-02 21:17:16 +05:00
Jeremy Bowman
efc04e3399 Remove notifier_api app DEPR-111 (#25464)
Part of the notifier service deprecation (DEPR-106).

Also removed pdfminer from the package uninstall list, since we no longer install the package it conflicts with either.
2020-10-29 11:17:23 -04:00
Feanil Patel
1e4866e89b Merge branch 'master' into alanoe/fix_npm_install_error_handling_in_master 2020-06-26 15:58:37 -04:00
morenol
a4a7e63ef8 Remove usage of enum34, since we are already in python>=3.4 (#24337)
enum34 is causing problems in python3.8 tests of edx-platform because it has incompatibility with recent versions of python, the error the error happens while importing the re module in these python versions.

This library is a backport of enum of python3.4 made for python<3.4, therefore is not needed anymore.

edx-val was updated to remove that dependency: https://github.com/edx/edx-val/pull/245
2020-06-26 13:13:12 -04:00
M. Zulqarnain
bc568309ec BOM-1701: Ran pyupgrade on pavelib (#24230) 2020-06-17 17:09:38 +05:00
Alan Evangelista
30495b4580 Fix 'npm install' command execution error handling
'npm install' command execution was changed from paver.easy.sh()
to subprocess.Popen() in commit 0dd13fad1b,
but exception handling was not updated accordingly. Due to this,
errors in 'npm install' execution were not detected.
2020-04-19 19:40:21 -03:00
Ayub-khan
3c1140dc49 BOM-1045
-Upgrade edx-drf-extensions
-settings-update
2020-03-10 16:06:02 +05:00
Awais Jibran
9f456e28b7 Fix Pavelib prereqs.
Do not read file as bytes, as it would fail the comparison of byte with str.
PROD-1322
2020-02-26 22:48:20 +05:00
Jeremy Bowman
7bbd229526 Unpin more outdated dependencies (#22898)
Unpin several more outdated dependencies whose changelogs don't contain any significant backwards incompatible changes. Also add "moto" to the list of packages to uninstall from existing environments, since it requires a jsondiff version that clashes with the one we now use (triggering a harmless but distracting warning on dependency updates).

We can potentially stop using path.py/path altogether by switching to pathlib in the Python 3 standard library, but that merits a separate PR of its own.

Also, note that I'm not actually unpinning freezegun; different PRs restricted it in both constraints.txt and test.in, I'm just removing the latter redundant constraint.
2020-01-23 06:59:32 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Jeremy Bowman
63574e12b8 Remove pytest version constraint (#22626)
Fix the issue that was preventing us from upgrading pytest.  pytest does some manipulation of test packages that prevents `pkg_resources` from loading resources from them, but used to contain a workaround for the problem.  That workaround was [removed](https://github.com/pytest-dev/pytest/issues/5392) in 4.6.0 as a performance enhancement when pytest switched from `pkg_resources` to `importlib-metadata` for its own entrypoint handling.  This tripped up one of our test modules which defined classes that loaded templates from inside a test package.  Moving these resources to the parent package fixes the problem.

More and more, `pkg_resources` is being abandoned in favor of `importlib-metadata` and `importlib_resources` as they have a simpler design with much better performance.  However, `importlib_resources` doesn't support loading files from any directory which isn't itself a Python package (and doesn't allow direct use of paths including directories within the package).  Jinja2 chose a [different approach](https://github.com/pallets/jinja/pull/1082) that we may want to emulate in our resource handling.

Also fixed usage of a removed `pytest.raises()` parameter and a bug in our configuration of the `common/lib` tests that became a problem after the upgrade.
2019-12-30 09:10:57 -05:00
Jeremy Bowman
6f3e1e7e3d Fix remaining pavelib test failures BOM-598 (#21819) 2019-09-27 10:52:22 -04:00
Feanil Patel
61544f0e2c Fix paver for python 3. 2019-09-12 10:17:25 -04:00
Feanil Patel
f1ec3e97a9 Fix i18n extract command. 2019-09-05 16:31:48 -04:00
arbisoft
0726356d7c Fixing python-modernize issues. 2019-07-10 18:35:47 +05:00
J. Cliff Dyer
95aee94089 INCR-41: Replace pdfminer with pdfminer.six 2019-03-28 15:24:47 -07:00
Jeremy Bowman
39a28d2586 TE-2871 Switch to mysqlclient 2019-03-01 14:34:13 -05:00
cclauss
c0c935b685 Old style exceptions --> new style for Python 3 2019-02-19 13:09:23 +01:00
Matthew Piatetsky
6cf44a0467 fix unicode strings in pavelib/ 2019-02-05 09:14:20 -05:00
Michael Youngstrom
e7898d153d Move to python3-saml 2019-01-30 16:35:16 -05:00
cclauss
8fca11b85c Use print() function in both Python 2 and Python 3 2019-01-13 17:16:37 +01:00
Stuart Young
10cfd3434e remove paver timeout decorator 2018-10-01 13:43:02 -04:00
Stuart Young
c7ece71142 increase npm installation timeouts 2018-09-12 14:20:12 -04:00
Stuart Young
0dd13fad1b add paver timeout decorator and npm installation logs 2018-09-07 08:46:04 -04:00
Robert Raposa
58f6e92522 Upgrade DOT to 1.1.2. 2018-07-11 17:36:56 -04:00
Robert Raposa
9bb8f4272e Add warning for paver install_prereqs. 2018-07-11 17:00:30 -04:00
Michael Youngstrom
17238132b7 Remove NPM install for unittest runs 2018-06-29 12:47:55 -04:00
Jeremy Bowman
9ca9aa44c6 PLAT-2060 Use pip-tools to manage requirements files (take 2)
This reverts commit a7fa0c211d.
2018-04-12 17:22:48 -04:00
Feanil Patel
a7fa0c211d Revert "PLAT-2060 Use pip-tools to manage requirements files" 2018-04-10 12:54:41 -04:00
Jeremy Bowman
432347b881 PLAT-2060 Use pip-tools to manage requirements files 2018-04-09 17:07:02 -04:00