-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support making migrations #37
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7949d2e
Add helper script to make migrations
cc-a 8aa5358
Document how to make migrations in README
cc-a 204d54f
Make pytest ignore makemigrations.py
cc-a 1576d81
Merge branch 'main' into makemigrations
cc-a 0d0b677
Merge branch 'main' into makemigrations
cc-a File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""Minimal script to make migrations without a manage.py file.""" | ||
|
||
import sys | ||
|
||
import django | ||
from django.conf import settings | ||
|
||
settings.configure( | ||
INSTALLED_APPS=[ | ||
"django.contrib.auth", | ||
"django.contrib.admin", | ||
"django.contrib.contenttypes", | ||
"django.contrib.sites", | ||
"imperial_coldfront_plugin", | ||
], | ||
# below checks do not need to pass to makemigrations | ||
SILENCED_SYSTEM_CHECKS=[ | ||
"admin.E403", | ||
"admin.E406", | ||
"admin.E408", | ||
"admin.E409", | ||
"admin.E410", | ||
], | ||
) | ||
django.setup() | ||
|
||
if __name__ == "__main__": | ||
from django.core.management import call_command | ||
|
||
call_command("makemigrations", *sys.argv[1:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ version = "0.1.0" | |
description = "A plugin for the Coldfront HPC management platform." | ||
authors = [ | ||
{ name = "Christopher Cave-Ayland", email = "[email protected]" }, | ||
{ name = "Imperial College London RSE Team", email = "[email protected]" } | ||
{ name = "Imperial College London RSE Team", email = "[email protected]" }, | ||
] | ||
requires-python = "~=3.11" | ||
dependencies = [ | ||
|
@@ -42,7 +42,9 @@ requires = ["setuptools", "setuptools-scm"] | |
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools.packages.find] | ||
exclude = ["htmlcov"] # Exclude the coverage report file from setuptools package finder | ||
exclude = [ | ||
"htmlcov", | ||
] # Exclude the coverage report file from setuptools package finder | ||
|
||
[tool.mypy] | ||
disallow_any_explicit = true | ||
|
@@ -66,7 +68,7 @@ module = ["imperial_coldfront_plugin.oidc"] | |
disallow_any_explicit = false | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "-v --mypy -p no:warnings --cov=imperial_coldfront_plugin --cov-report=html --doctest-modules --ignore=docs" | ||
addopts = "-v --mypy -p no:warnings --cov=imperial_coldfront_plugin --cov-report=html --doctest-modules --ignore=docs --ignore=makemigrations.py" | ||
|
||
[tool.ruff] | ||
exclude = ["*/migrations"] | ||
|
@@ -79,12 +81,15 @@ select = [ | |
"F", # Pyflakes | ||
"I", # isort | ||
"UP", # pyupgrade | ||
"RUF" # ruff | ||
"RUF", # ruff | ||
] | ||
pydocstyle.convention = "google" | ||
|
||
[tool.ruff.lint.per-file-ignores] | ||
"tests/*" = ["D100", "D104"] # Missing docstring in public module, Missing docstring in public package | ||
"tests/*" = [ | ||
"D100", | ||
"D104", | ||
] # Missing docstring in public module, Missing docstring in public package | ||
|
||
[tool.django-stubs] | ||
django_settings_module = "imperial_coldfront_plugin" # a lie but seems to satisfy | ||
django_settings_module = "imperial_coldfront_plugin" # a lie but seems to satisfy |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might need to also ignore the migrations folder itself when we make one