Conversation
* add type hints: part 1 Converting old docstring-based type hints to PEP 484 type hints. This commit includes all of cms/ except for cms/server/, and all of cmscommon/. * python 3.11 compatibility (use typing.TypeVar instead of new syntax) * add type hints part 2 Added type hints to cms/server and fixed some previous type hint mistakes. * type hints for cmsranking * more type hint fixes guard all tornado imports behind `if typing.TYPE_CHECKING`. i think this allows the "tornado4" workaround to still work, though i don't know if it's relevant anymore. * type hints for cmscontrib (and prerequisites.py) * type hints for cmstestsuite * make PriorityQueue and TriggeredService generic * Update Python version requirement to 3.11 * Run `black` on modified files * update CONTRIBUTING.md * address review comments * Some better type hints on FileCacher / LargeObject Use typing.IO[bytes] instead of BinaryIO, because some stdlib types are apparently only compatible with the former.
Currently, we log to stdout, which is contrary to UNIX conventions. Also, it makes it impossible to redirect normal standard output of commands like cmsRWSHelper to a file. Closes cms-dev#1382.
Co-authored-by: Németh Zsolt <[email protected]>
Evaluation outcome is stored as a formatted string with "%" serving as a formatting control character. We therefore need to escape percent signs in manager output. Previously, some ANSI escape sequences (ESC + arbitrary characters + m, which is a superset of SGR sequences) were removed from the messages. We argue that all programs emitting such sequences without checking that the output is a terminal are broken and we should not sweep the problem under the rug. Instead, we firmly reject all control characters in C0 and C1 ranges except for TAB.
Co-authored-by: Barnabás Pőcze <[email protected]>
It is very useful for the scientific commitee to see it in the Comment column of the submissions page in the admin website. This column was mostly unused and empty in the past.
Suggested-by: Németh Zsolt <[email protected]>
To improve performance when connecting to worker instances over high latency network
It is useful when a stand-alone script needs to talk to a remote service, because service.connect() returns while the connection attempt is being done in the background.
Co-authored-by: Gregor Eesmaa <[email protected]>
* use `` in places where bare ` were used previously * fix missing references and other sphinx errors * change json code-blocks to use comments to indicate the types of things * updated some docs that referred to unsupported installation methods * remove link to distutils, and fix old setuptools link * rename "target directory" to "installation directory"
Previously, we tried to find shared-mime-info.mo and use that to translate the descriptions obtained from xdg.Mime into the right language. This was not the correct approach: first, the path to shared-mime-info.mo varied (on Ubuntu it was in locale-langpack instead of locale), and second, sometimes (e.g. on Fedora) it was not present at all. The right place to find these translations is in the mimetype xml files themselves. However, this caused other issues: first, pyxdg does not have proper support for using more than one language. I hacked around this by setting the (global) language before each call, and clearing pyxdg's own cache. And then adding my own cache on top that can cache multiple languages. The second problem was that on Debian/Ubuntu, the xml:lang tags that specify the language codes for each string use an incorrect format: they use POSIX-style locale names (like zh_CN) instead of XML-compliant BCP47 language codes (like zh-Hans-CN). pyxdg only knows how to handle these incorrect names, so I had to implement a hack to get it to recognize the correct names too. Also deleted the undocumented and now-unused shared_mime_info_prefix config option, and mentioned shared-mime-info as a dependency in the installation docs.
* Remove unneeded import attempts from "tornado4". From what I can tell, this was only ever useful when using system packages on ubuntu 20.04. We don't support installation using system packages anymore (and ubuntu 20.04 is EOL). * Remove misleading comment about monkey-patching the DB connection string in the test suite. We don't monkey-patch it anymore (instead we assume someone else fixed it and assert that it's correct).
When multiple versions of C++ are enabled in a contest, it is impossible to guess the language by filename extension. It is not checked that the language is really enabled in the contest. We consider this a feature (and document it as such), because it allows the administrator to test languages before they are made available to the contestants.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This should resolve #39 (was implemented upstream and is now available as
grace_period(time_to_end_of_contest)in the contest-config)