22# /// script
33# requires-python = ">=3.11"
44# dependencies = [
5- # "black~=26.3",
6- # "jamldump>=1.2.0,<1.3.0",
7- # "jinja2>=3.1.6,<3.2.0",
5+ # "jamldump>=1.2.0,<1.3",
6+ # "jinja2>=3.1.6,<3.2",
87# "packaging>=26.0,<27",
9- # "pyyaml>=6.0.3,<6.1.0 ",
8+ # "pyyaml>=6.0.3,<6.1",
109# "requests~=2.32.3",
11- # "requests-cache>=1.3.0,<1.4.0",
12- # "tomlkit>=0.14.0,<0.14.1",
10+ # "requests-cache>=1.3.0,<1.4",
11+ # "ruff>=0.15.11,<0.16",
12+ # "tomlkit>=0.14.0,<0.15",
1313# ]
1414# ///
1515
@@ -29,7 +29,6 @@ from jinja2 import Environment, FileSystemLoader
2929import utils
3030
3131DEFAULT_SETTINGS = {
32- "black" : True ,
3332 "check_commit_message" : True ,
3433 "check_gettext" : True ,
3534 "check_manifest" : True ,
@@ -46,10 +45,9 @@ DEFAULT_SETTINGS = {
4645 "disabled_redis_runners" : [],
4746 "docker_fixtures" : False ,
4847 "extra_files" : [],
49- "flake8_ignore" : [],
50- "flake8" : True ,
5148 "github_org" : "pulp" ,
5249 "latest_release_branch" : None ,
50+ "lint_ignore" : [],
5351 "lint_requirements" : True ,
5452 "os_required_packages" : [],
5553 "parallel_test_workers" : 8 ,
@@ -130,7 +128,6 @@ DEFAULT_SETTINGS = {
130128 },
131129 },
132130 },
133- "pydocstyle" : True ,
134131 "release_email" : "pulp-infra@redhat.com" ,
135132 "release_user" : "pulpbot" ,
136133 "stalebot_days_until_close" : 30 ,
@@ -170,6 +167,7 @@ DEPRECATED_FILES = {
170167 ".ci/scripts/update_github.sh" ,
171168 ".ci/scripts/update_redmine.sh" ,
172169 ".ci/scripts/upper_bound.py" ,
170+ ".flake8" ,
173171 ".github/template_gitref" ,
174172 ".github/workflows/kanban.yml" ,
175173 ".github/workflows/changelog.yml" ,
@@ -188,6 +186,7 @@ DEPRECATED_FILES = {
188186 ".github/workflows/scripts/publish_plugin_pypi.sh" ,
189187 ".travis" ,
190188 ".travis.yml" ,
189+ "dev_requirements.txt" ,
191190 "flake8.cfg" ,
192191 "CHANGES/.TEMPLATE.rst" ,
193192 ],
@@ -321,10 +320,20 @@ def load_config(plugin_config_path: Path, verbose: bool) -> tuple[dict[str, t.An
321320 # Migrate api_root to (scenario) setting
322321 if config ["pulp_settings" ] is None :
323322 config ["pulp_settings" ] = {}
324- config ["pulp_settings" ].setdefault ("api_root" , config .get ("api_root" , "/pulp/" ))
323+ write_new_config = True
324+ if "api_root" not in config ["pulp_settings" ]:
325+ config ["pulp_settings" ]["api_root" ] = "/pulp/"
326+ write_new_config = True
325327 if config ["pulp_settings_s3" ] is None :
326328 config ["pulp_settings_s3" ] = {}
327- config ["pulp_settings_s3" ].setdefault ("api_root" , "/rerouted/djnd/" )
329+ write_new_config = True
330+ if "api_root" not in config ["pulp_settings_s3" ]:
331+ config ["pulp_settings_s3" ]["api_root" ] = "/rerouted/djnd/"
332+ write_new_config = True
333+ # Migrate flake8_ignore
334+ if "flake8_ignore" in config :
335+ config ["lint_ignore" ] = config .pop ("flake8_ignore" )
336+ write_new_config = True
328337 # remove deprecated options
329338 for key in set (config .keys ()) - set (DEFAULT_SETTINGS .keys ()):
330339 config .pop (key )
@@ -385,7 +394,6 @@ def write_template_section(
385394 "current_version" : utils .current_version (plugin_root_dir ),
386395 "pulpdocs_branch" : PULPDOCS_BRANCH ,
387396 "is_pulpdocs_member" : config ["plugin_name" ] in utils .get_pulpdocs_members (PULPDOCS_BRANCH ),
388- "black_requirement" : utils .black_requirement (),
389397 "config" : config ,
390398 ** config ,
391399 }
@@ -501,11 +509,10 @@ def remove_deprecated_files(plugin_root_dir: Path, sections: list[str]) -> None:
501509
502510
503511def reformat_files (plugin_root_dir : Path , config : dict [str , t .Any ]) -> None :
504- if config ["black" ]:
505- try :
506- subprocess .run (["black" , "--quiet" , "." ], cwd = plugin_root_dir )
507- except FileNotFoundError :
508- pass
512+ try :
513+ subprocess .run (["ruff" , "format" ], cwd = plugin_root_dir )
514+ except FileNotFoundError :
515+ pass
509516
510517
511518if __name__ == "__main__" :
0 commit comments