Skip to content

Commit

Permalink
Projects: remove requirements_file (#11132)
Browse files Browse the repository at this point in the history
* Projects: remove old/non-used fields

Follow safe migrations instructions from
https://dev.readthedocs.io/en/latest/migrations.html to remove these fields.

* Lint

* Keep `Project.documentation_type` to avoid breaking changes

* Remove fields from fixture

* Remove more leftovers

* Lint

* Rename migrations

* Fix tests

* Projects: remove `requirements_file`

This field is not required anymore. It has to be defined in the YAML config file
now. This PR continues the work done in #11124

* Update migration
  • Loading branch information
humitos committed Mar 25, 2024
1 parent 7ea7783 commit de43815
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 33 deletions.
1 change: 0 additions & 1 deletion readthedocs/api/v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class Meta(ProjectSerializer.Meta):
"container_mem_limit",
"container_time_limit",
"skip",
"requirements_file",
"features",
"has_valid_clone",
"has_valid_webhook",
Expand Down
17 changes: 0 additions & 17 deletions readthedocs/projects/fixtures/test_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -61,7 +60,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -107,7 +105,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -153,7 +150,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -199,7 +195,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -245,7 +240,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -291,7 +285,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -337,7 +330,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -383,7 +375,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -429,7 +420,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -475,7 +465,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -521,7 +510,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -567,7 +555,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -613,7 +600,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -657,7 +643,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -701,7 +686,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down Expand Up @@ -745,7 +729,6 @@
"single_version": false,
"default_version": "latest",
"default_branch": null,
"requirements_file": null,
"documentation_type": "sphinx",
"external_builds_enabled": false,
"external_builds_privacy_level": "public",
Expand Down
23 changes: 23 additions & 0 deletions readthedocs/projects/migrations/0121_remove_requirements_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.10 on 2024-02-21 11:36

from django.db import migrations
from django_safemigrate import Safe


class Migration(migrations.Migration):
safe = Safe.after_deploy

dependencies = [
("projects", "0120_docdiff_helptext"),
]

operations = [
migrations.RemoveField(
model_name="historicalproject",
name="requirements_file",
),
migrations.RemoveField(
model_name="project",
name="requirements_file",
),
]
14 changes: 0 additions & 14 deletions readthedocs/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,20 +325,6 @@ class Project(models.Model):
"to use the default value for your VCS.",
),
)
requirements_file = models.CharField(
_("Requirements file"),
max_length=255,
default=None,
null=True,
blank=True,
help_text=_(
"A <a "
'href="https://pip.pypa.io/en/latest/user_guide.html#requirements-files">'
"pip requirements file</a> needed to build your documentation. "
"Path from the root of your project.",
),
)

custom_prefix = models.CharField(
_("Custom path prefix"),
max_length=255,
Expand Down
1 change: 0 additions & 1 deletion readthedocs/rtd_tests/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3282,7 +3282,6 @@ def test_get_version_by_id(self):
"programming_language": "words",
"repo": "https://github.com/pypa/pip",
"repo_type": "git",
"requirements_file": None,
"readthedocs_yaml_path": None,
"show_advertising": True,
"skip": False,
Expand Down

0 comments on commit de43815

Please sign in to comment.