Skip to content
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

fixing most of ruff-minimal outside of src/sage #39339

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/sage_bootstrap/download/mirror_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ def _rank_mirrors(self):
This method is used by the YUM fastestmirror plugin
"""
timed_mirrors = []
import time, socket
import time
import socket
log.info('Searching fastest mirror')
timeout = 1
for mirror in self.mirrors:
Expand Down
4 changes: 2 additions & 2 deletions pkgs/sage-conf_conda/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def run(self):
print("Warning: A configuration has been written, but the configure script has exited with an error. "
"Carefully check any messages above before continuing.")
else:
print(f"Error: The configure script has failed; this may be caused by missing build prerequisites.")
print("Error: The configure script has failed; this may be caused by missing build prerequisites.")
sys.stdout.flush()
PREREQ_SPKG = "_prereq bzip2 xz libffi" # includes python3 SPKG_DEPCHECK packages
os.system(f'cd {SAGE_ROOT} && export PACKAGES="$(build/bin/sage-get-system-packages conda {PREREQ_SPKG})" && [ -n "$PACKAGES" ] && echo "You can install the required build prerequisites using the following shell command" && echo "" && build/bin/sage-print-system-package-command conda --verbose --sudo install $PACKAGES && echo ""')
Expand Down Expand Up @@ -73,7 +73,7 @@ def _create_writable_sage_root(self):

def ignore(path, names):
# exclude all embedded src trees
if fnmatch.fnmatch(path, f'*/build/pkgs/*'):
if fnmatch.fnmatch(path, '*/build/pkgs/*'):
return ['src']
### ignore more stuff --- .tox etc.
return [name for name in names
Expand Down
4 changes: 2 additions & 2 deletions pkgs/sage-conf_pypi/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def run(self):
print(f"Running {cmd}")
sys.stdout.flush()
if os.system(cmd) != 0:
print(f"configure failed; this may be caused by missing build prerequisites.")
print("configure failed; this may be caused by missing build prerequisites.")
sys.stdout.flush()
PREREQ_SPKG = "_prereq bzip2 xz libffi" # includes python3 SPKG_DEPCHECK packages
os.system(f'cd {SAGE_ROOT} && export SYSTEM=$(build/bin/sage-guess-package-system 2>/dev/null) && export PACKAGES="$(build/bin/sage-get-system-packages $SYSTEM {PREREQ_SPKG})" && [ -n "$PACKAGES" ] && echo "You can install the required build prerequisites using the following shell command" && echo "" && build/bin/sage-print-system-package-command $SYSTEM --verbose --sudo install $PACKAGES && echo ""')
Expand Down Expand Up @@ -95,7 +95,7 @@ def _create_writable_sage_root(self):

def ignore(path, names):
# exclude all embedded src trees
if fnmatch.fnmatch(path, f'*/build/pkgs/*'):
if fnmatch.fnmatch(path, '*/build/pkgs/*'):
return ['src']
### ignore more stuff --- .tox etc.
return [name for name in names
Expand Down
3 changes: 2 additions & 1 deletion pkgs/sage-sws2rst/sage_sws2rst/worksheet2rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ def code_parser(text):
lines = ['::', '']
for s in text.splitlines():
l = s[6:] if s.startswith('sage: ') else s
if not l: continue
if not l:
continue
prefix = ' ....: ' if l[0] == ' ' else ' sage: '
lines.append(prefix + l)
return '\n'.join(lines)
Expand Down
4 changes: 2 additions & 2 deletions src/doc/el/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

# Add small view/edit buttons.
html_theme_options.update({
'source_view_link': os.path.join(source_repository, f'blob/develop/src/doc/el/a_tour_of_sage', '{filename}'),
'source_edit_link': os.path.join(source_repository, f'edit/develop/src/doc/el/a_tour_of_sage', '{filename}'),
'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/el/a_tour_of_sage', '{filename}'),
'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/el/a_tour_of_sage', '{filename}'),
})

# General information about the project.
Expand Down
4 changes: 2 additions & 2 deletions src/doc/en/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

# Add small view/edit buttons.
html_theme_options.update({
'source_view_link': os.path.join(source_repository, f'blob/develop/src/doc/en/a_tour_of_sage', '{filename}'),
'source_edit_link': os.path.join(source_repository, f'edit/develop/src/doc/en/a_tour_of_sage', '{filename}'),
'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/en/a_tour_of_sage', '{filename}'),
'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/en/a_tour_of_sage', '{filename}'),
})

# General information about the project.
Expand Down
4 changes: 2 additions & 2 deletions src/doc/tr/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

# Add small view/edit buttons.
html_theme_options.update({
'source_view_link': os.path.join(source_repository, f'blob/develop/src/doc/tr/a_tour_of_sage', '{filename}'),
'source_edit_link': os.path.join(source_repository, f'edit/develop/src/doc/tr/a_tour_of_sage', '{filename}'),
'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/tr/a_tour_of_sage', '{filename}'),
'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/tr/a_tour_of_sage', '{filename}'),
})

# General information about the project.
Expand Down
4 changes: 2 additions & 2 deletions src/sage_docbuild/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,8 @@ def add_page_context(app, pagename, templatename, context, doctree):
# source files are generated.
suffix = '.py' if importlib.import_module(pagename.replace('/','.')).__file__.endswith('.py') else '.pyx'
context['page_source_suffix'] = suffix
context['theme_source_view_link'] = os.path.join(source_repository, f'blob/develop/src', '{filename}')
context['theme_source_edit_link'] = os.path.join(source_repository, f'edit/develop/src', '{filename}')
context['theme_source_view_link'] = os.path.join(source_repository, 'blob/develop/src', '{filename}')
context['theme_source_edit_link'] = os.path.join(source_repository, 'edit/develop/src', '{filename}')


dangling_debug = False
Expand Down
1 change: 0 additions & 1 deletion src/sage_setup/autogen/giacpy-mkkeywords.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
python_packages = find_namespace_packages(where=SAGE_SRC, include=['sage', 'sage.*'])
log.debug(f"python_packages = {python_packages}")

log.info(f"Discovering Python/Cython source code... done")
log.info("Discovering Python/Cython source code... done")

# from sage_build_cython:
import Cython.Compiler.Options
Expand Down
Loading