From 91b7d3b4957b2340a17e607ae9332ec8f6dfba91 Mon Sep 17 00:00:00 2001 From: Michael Hucka Date: Mon, 3 Feb 2025 15:08:08 -0800 Subject: [PATCH 1/4] Update versions of dependencies & regenerate envs/*.txt files (#923) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Set execute bit on re-pip-compile-in-docker.sh Not sure why it wasn't executable, and I don't see a reason why it shouldn't be. * Update versions of dependencies & regenerate envs/*.txt files This updates many versions of Python packages in the requirements files, and includes refreshed outputs from the pip-compile script. * Update .pylintrc for Pylint 3.x The Pylint config file for 3.x has considerably changed from 2.x. The `.pylintrc` in this commit has many checks turned off. I ran `pylint` 3.3.3 repeatedly on the codebase, checking whether the warnings looked serious. For many that looked like probable code errors, I opened issues, but the work is incomplete. In the end I started disabling most checks because there was too much to do and we were aiming to do a release asap. We need to go back, re-enable checks in .pylintrc one by one, and correct the warnings in the code. * Add imports of type stubs for mypy This is not complete, but these are all the ones I could find for things that were flagged as missing by mypy. For those that I couldn’t find, I added exceptions in ../../conf/mypy.ini. * Update list of exceptions for missing stubs * Update envs requirements after adding mypy type stubs imports * Disable one more check Seems that python 3.12 deprecated a function. For now, I disabled deprecated function checks. * Tell mypy about more missing imports * Ignore all mypy errors for now There are still a couple of hundred errors reported by mypy. In the interest of getting the next release out today, I set `ignore_errors` to True. TODO: come back and re-enable errors after the next release. * Pin jax & jaxlib versions A conflict between some packages and jax/jaxlib 0.5.x showed up on the GitHub runners. I didn't experience the same locally, but it doesn't look it's a problem to go down to 0.4.38, so let's do that. * pylint.txt needs to include more dependencies Pylint needs to import the python packages used in modules it checks. Some of what it needs are only imported by other requirements files, so the pylint one has to reference the others. * Update pip-compiled requirements files This updates them to the latest output of pip-compile given the most recent edits to the individual dependency files. * Update pyproject.toml Python versions for Black --- dev_tools/conf/.pylintrc | 1005 ++++++++++++++++- dev_tools/conf/mypy.ini | 17 +- dev_tools/requirements/deps/format.txt | 2 +- dev_tools/requirements/deps/mypy.txt | 7 +- dev_tools/requirements/deps/pip-tools.txt | 2 +- dev_tools/requirements/deps/pylint.txt | 5 +- .../deps/resource_estimates_runtime.txt | 6 +- dev_tools/requirements/deps/runtime.txt | 10 +- dev_tools/requirements/envs/dev.env.txt | 162 +-- dev_tools/requirements/envs/format.env.txt | 65 +- dev_tools/requirements/envs/mypy.env.txt | 85 +- dev_tools/requirements/envs/pip-tools.env.txt | 16 +- dev_tools/requirements/envs/pylint.env.txt | 195 +++- .../requirements/envs/pytest-extra.env.txt | 104 +- dev_tools/requirements/envs/pytest.env.txt | 90 +- dev_tools/requirements/max_compat/dev.env.txt | 78 +- .../max_compat/pytest-max-compat.env.txt | 78 +- .../requirements/re-pip-compile-in-docker.sh | 0 pyproject.toml | 2 +- 19 files changed, 1548 insertions(+), 381 deletions(-) mode change 100644 => 100755 dev_tools/requirements/re-pip-compile-in-docker.sh diff --git a/dev_tools/conf/.pylintrc b/dev_tools/conf/.pylintrc index 1b58f4379..2e9221223 100644 --- a/dev_tools/conf/.pylintrc +++ b/dev_tools/conf/.pylintrc @@ -1,31 +1,1014 @@ -[config] +# Summary: config file for Pylint versions 3.0 and above. +# See https://pylint.readthedocs.io/ for info about options available. + +[MAIN] + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Clear in-memory caches upon conclusion of linting. Useful if running pylint +# in a server-like mode. +clear-cache-post-run=no + +# Load and enable all available extensions. Use --list-extensions to see a list +# all available extensions. +#enable-all-extensions= + +# In error mode, messages with a category besides ERROR or FATAL are +# suppressed, and no reports are done by default. Error mode is compatible with +# disabling specific errors. +#errors-only= + +# Always return a 0 (non-error) status code, even if lint errors are found. +# This is primarily useful in continuous integration scripts. +#exit-zero= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. +extension-pkg-allow-list= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. (This is an alternative name to extension-pkg-allow-list +# for backward compatibility.) +extension-pkg-whitelist= + +# Return non-zero exit code if any of these messages/categories are detected, +# even if score is above --fail-under value. Syntax same as enable. Messages +# specified are enabled, while categories only check already-enabled messages. +fail-on= + +# Specify a score threshold under which the program will exit with error. +fail-under=10 + +# Interpret the stdin as a python script, whose filename needs to be passed as +# the module_or_package argument. +#from-stdin= + +# Files or directories to be skipped. They should be base names, not paths. +ignore=.git,.github,.mypy_cache,.pytest_cache,__pycache__,docs,third_party + +# Add files or directories matching the regular expressions patterns to the +# ignore-list. The regex matches against paths and can be in Posix or Windows +# format. Because '\\' represents the directory delimiter on Windows systems, +# it can't be used as an escape character. +ignore-paths= + +# Files or directories matching the regular expression patterns are skipped. +# The regex matches against base names, not paths. The default value ignores +# Emacs file lock files. +ignore-patterns=(^\.#|.*_test\.py) + +# List of module names for which member attributes should not be checked and +# will not be imported (useful for modules/projects where namespaces are +# manipulated during runtime and thus existing member attributes cannot be +# deduced by static analysis). It supports qualified module names, as well as +# Unix pattern matching. +ignored-modules= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use, and will cap the count on Windows to +# avoid hangs. +jobs=0 + +# Control the amount of potential inferred values when inferring a single +# object. This can help the performance when dealing with large functions or +# complex, nested conditions. +limit-inference-results=100 + +# List of plugins (as comma separated values of python module names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Resolve imports to .pyi stubs if available. May reduce no-member messages and +# increase not-an-iterable messages. +prefer-stubs=no + +# Minimum Python version to use for version dependent checks. Will default to +# the version used to run pylint. +py-version=3.10 + +# Discover python modules and packages in the file system subtree. +recursive=yes + +# Add paths to the list of the source roots. Supports globbing patterns. The +# source root is an absolute path or a path relative to the current working +# directory used to determine a package namespace for modules located under the +# source root. +source-roots= + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + +# In verbose mode, extra non-checker-related info will be displayed. +#verbose= + + +[BASIC] + +# Naming style matching correct argument names. +argument-naming-style=snake_case + +# Regular expression matching correct argument names. Overrides argument- +# naming-style. If left empty, argument names will be checked with the set +# naming style. +argument-rgx=[a-z_][a-z0-9_]{0,30}$ + +# Naming style matching correct attribute names. +attr-naming-style=snake_case + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. If left empty, attribute names will be checked with the set naming +# style. +attr-rgx=[a-z_][a-z0-9_]{0,30}$ + +# Bad variable names which should always be refused, separated by a comma. +bad-names=foo, + baz + +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +bad-names-rgxs= + +# Naming style matching correct class attribute names. +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. If left empty, class attribute names will be checked +# with the set naming style. +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Naming style matching correct class constant names. +class-const-naming-style=UPPER_CASE + +# Regular expression matching correct class constant names. Overrides class- +# const-naming-style. If left empty, class constant names will be checked with +# the set naming style. +#class-const-rgx= + +# Naming style matching correct class names. +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming- +# style. If left empty, class names will be checked with the set naming style. +class-rgx=[A-Z_][a-zA-Z0-9]+$ + +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style. If left empty, constant names will be checked with the set naming +# style. +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names. +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style. If left empty, function names will be checked with the set +# naming style. +function-rgx=[a-z_][a-z0-9_]{2,65}$ + +# Good variable names which should always be accepted, separated by a comma. +good-names=i, + j, + k, + ex, + Run, + _, + n, + m, + x, + y, + z + +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +good-names-rgxs= + +# Include a hint for the correct naming format with invalid-name. +include-naming-hint=yes + +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. If left empty, inline iteration names will be checked +# with the set naming style. +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ + +# Naming style matching correct method names. +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style. If left empty, method names will be checked with the set naming style. +method-rgx=[a-z_][a-z0-9_]{2,60}$ + +# Naming style matching correct module names. +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style. If left empty, module names will be checked with the set naming style. +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +# These decorators are taken in consideration only for invalid-name. +property-classes=abc.abstractproperty + +# Regular expression matching correct type alias names. If left empty, type +# alias names will be checked with the set naming style. +#typealias-rgx= + +# Regular expression matching correct type variable names. If left empty, type +# variable names will be checked with the set naming style. +#typevar-rgx= + +# Naming style matching correct variable names. +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style. If left empty, variable names will be checked with the set +# naming style. +variable-rgx=[a-z_][a-z0-9_]{0,30}$ + + +[CLASSES] + +# Warn about protected attribute access inside special methods +check-protected-access-in-special-methods=no + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp, + asyncSetUp, + __post_init__ + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# List of regular expressions of class ancestor names to ignore when counting +# public methods (see R0903) +exclude-too-few-public-methods= + +# List of qualified class names to ignore when counting class parents (see +# R0901) +ignored-parents= + +# Maximum number of arguments for function / method. +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=35 + +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 + +# Maximum number of branch for function / method body. +max-branches=20 + +# Maximum number of locals for function / method body. +max-locals=35 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of positional arguments for function / method. +max-positional-arguments=10 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=30 + +# Maximum number of return / yield for function / method body. +max-returns=6 + +# Maximum number of statements in function / method body. +max-statements=70 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=0 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when caught. +overgeneral-exceptions=builtins.BaseException,builtins.Exception + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^(.*#\w*pylint: disable.*|\s*(# )??)$ + +# Number of spaces of indent required inside a hanging or continued line.indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. max-line-length=100 + +# Maximum number of lines in a module. +max-module-lines=10000 + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[IMPORTS] + +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level= + +# Allow explicit reexports by alias from a package __init__. +allow-reexport-from-package=no + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules= + +# Output a graph (.gv or any supported image format) of external dependencies +# to the given file (report RP0402 must not be disabled). +ext-import-graph= + +# Output a graph (.gv or any supported image format) of all (i.e. internal and +# external) dependencies to the given file (report RP0402 must not be +# disabled). +import-graph= + +# Output a graph (.gv or any supported image format) of internal dependencies +# to the given file (report RP0402 must not be disabled). +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= + + +[LOGGING] + +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=new + +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, +# UNDEFINED. +confidence=HIGH, + CONTROL_FLOW, + INFERENCE, + INFERENCE_FAILURE, + UNDEFINED + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then re-enable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". disable=all -ignore-patterns=.*_pb2\.py,quantum_engine_service_client.py,engine_pb2_grpc.py -output-format=colorized -score=no -reports=no + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. enable= - init-is-generator, - line-too-long, - anomalous-backslash-in-string, +# abstract-class-instantiated, +# abstract-method, + access-member-before-definition, +# anomalous-backslash-in-string, + anomalous-unicode-escape-in-string, +# arguments-differ, +# arguments-out-of-order, +# arguments-renamed, + assert-on-string-literal, assert-on-tuple, + assigning-non-slot, + assignment-from-no-return, + assignment-from-none, +# attribute-defined-outside-init, + await-outside-async, + bad-chained-comparison, +# bad-classmethod-argument, + bad-except-order, + bad-exception-cause, + bad-file-encoding, + bad-format-character, + bad-format-string, + bad-format-string-key, bad-indentation, - bad-option-value, + bad-inline-option, + bad-mcs-classmethod-argument, + bad-mcs-method-argument, + bad-open-mode, bad-reversed-sequence, + bad-staticmethod-argument, +# bad-str-strip-call, + bad-string-format-type, bad-super-call, + bad-thread-instantiation, +# bare-except, + bidirectional-unicode, + binary-op-exception, + boolean-datetime, + broad-exception-caught, + broad-exception-raised, + c-extension-no-member, + catching-non-exception, +# cell-var-from-loop, + chained-comparison, + class-variable-slots-conflict, + comparison-of-constants, + comparison-with-callable, + comparison-with-itself, + condition-evals-to-constant, + confusing-with-statement, +# consider-iterating-dictionary, consider-merging-isinstance, + consider-swap-variables, + consider-using-dict-comprehension, +# consider-using-dict-items, +# consider-using-enumerate, +# consider-using-f-string, +# consider-using-from-import, +# consider-using-generator, + consider-using-get, +# consider-using-in, + consider-using-join, +# consider-using-max-builtin, +# consider-using-min-builtin, +# consider-using-set-comprehension, + consider-using-sys-exit, + consider-using-ternary, +# consider-using-with, + contextmanager-generator-missing-cleanup, continue-in-finally, +# cyclic-import, dangerous-default-value, + declare-non-slot, + deprecated-argument, + deprecated-attribute, + deprecated-class, +# deprecated-decorator, +# deprecated-method, +# deprecated-module, + deprecated-pragma, + dict-iter-missing-items, + disallowed-name, duplicate-argument-name, + duplicate-bases, + duplicate-code, + duplicate-except, +# duplicate-key, + duplicate-string-formatting-argument, + duplicate-value, + empty-docstring, + eval-used, + exec-used, expression-not-assigned, +# f-string-without-interpolation, + file-ignored, +# fixme, + forgotten-debug-statement, + format-combined-specification, + format-needs-mapping, +# format-string-without-interpolation, function-redefined, + global-at-module-level, +# global-statement, + global-variable-not-assigned, + global-variable-undefined, + implicit-flag-alias, +# implicit-str-concat, + import-error, +# import-outside-toplevel, + import-self, inconsistent-mro, + inconsistent-quotes, +# inconsistent-return-statements, + inherit-non-class, + init-is-generator, + invalid-all-format, + invalid-all-object, + invalid-bool-returned, + invalid-bytes-returned, + invalid-character-backspace, + invalid-character-carriage-return, + invalid-character-esc, + invalid-character-nul, + invalid-character-sub, + invalid-character-zero-width-space, + invalid-characters-in-docstring, + invalid-class-object, + invalid-enum-extension, + invalid-envvar-default, + invalid-envvar-value, + invalid-field-call, + invalid-format-index, + invalid-format-returned, + invalid-getnewargs-ex-returned, + invalid-getnewargs-returned, + invalid-hash-returned, + invalid-index-returned, + invalid-length-hint-returned, + invalid-length-returned, + invalid-metaclass, +# invalid-name, + invalid-overridden-method, + invalid-repr-returned, + invalid-sequence-index, + invalid-slice-index, + invalid-slice-step, + invalid-slots, + invalid-slots-object, + invalid-star-assignment-target, + invalid-str-returned, + invalid-unary-operand-type, + invalid-unicode-codec, + isinstance-second-argument-not-valid-type, + keyword-arg-before-vararg, + kwarg-superseded-by-positional-arg, + line-too-long, + literal-comparison, +# locally-disabled, +# logging-format-interpolation, +# logging-format-truncated, +# logging-fstring-interpolation, +# logging-not-lazy, +# logging-too-few-args, +# logging-too-many-args, +# logging-unsupported-format, + lost-exception, + method-cache-max-size-none, + method-check-failed, + method-hidden, + misplaced-bare-raise, + misplaced-format-function, + misplaced-future, +# missing-class-docstring, +# missing-final-newline, + missing-format-argument-key, + missing-format-attribute, + missing-format-string-key, +# missing-function-docstring, + missing-kwoa, +# missing-module-docstring, + missing-parentheses-for-call-in-test, +# missing-timeout, + mixed-format-string, + mixed-line-endings, + modified-iterating-dict, + modified-iterating-list, + modified-iterating-set, + multiple-imports, + multiple-statements, + named-expr-without-context, + nan-comparison, + nested-min-max, + no-classmethod-decorator, +# no-else-break, +# no-else-continue, +# no-else-raise, +# no-else-return, +# no-member, + no-method-argument, +# no-name-in-module, + no-self-argument, + no-staticmethod-decorator, +# no-value-for-parameter, + non-ascii-file-name, + non-ascii-module-import, + non-ascii-name, + non-iterator-returned, + non-parent-init-called, + non-str-assignment-to-dunder-name, + nonexistent-operator, + nonlocal-and-global, + nonlocal-without-binding, + not-a-mapping, + not-an-iterable, + not-async-context-manager, + not-callable, + not-context-manager, + not-in-loop, + notimplemented-raised, + overridden-final-method, + pointless-exception-statement, +# pointless-statement, +# pointless-string-statement, + positional-only-arguments-expected, + possibly-unused-variable, +# possibly-used-before-assignment, + potential-index-error, + preferred-module, + property-with-parameters, +# protected-access, +# raise-missing-from, + raising-bad-type, + raising-format-tuple, + raising-non-exception, + raw-checker-failed, + redeclared-assigned-name, + redefined-argument-from-local, +# redefined-builtin, +# redefined-outer-name, + redefined-slots-in-subclass, + redundant-keyword-arg, +# redundant-u-string-prefix, + redundant-unittest-assert, +# reimported, + relative-beyond-top-level, + repeated-keyword, + return-arg-in-generator, + return-in-finally, + return-in-init, + return-outside-function, +# self-assigning-variable, + self-cls-assignment, + shadowed-import, + shallow-copy-environ, +# signature-differs, + simplifiable-condition, +# simplifiable-if-expression, + simplifiable-if-statement, + simplify-boolean-expression, + single-string-used-for-slots, + singledispatch-method, + singledispatchmethod-function, +# singleton-comparison, + star-needs-assignment-target, +# stop-iteration-return, + subclassed-final-class, + subprocess-popen-preexec-fn, + subprocess-run-check, + super-init-not-called, +# super-with-arguments, + super-without-brackets, +# superfluous-parens, +# suppressed-message, + syntax-error, + too-few-format-args, + too-few-public-methods, +# too-many-ancestors, +# too-many-arguments, +# too-many-boolean-expressions, +# too-many-branches, +# too-many-format-args, +# too-many-function-args, +# too-many-instance-attributes, +# too-many-lines, +# too-many-locals, +# too-many-nested-blocks, +# too-many-positional-arguments, +# too-many-public-methods, +# too-many-return-statements, + too-many-star-expressions, +# too-many-statements, + trailing-comma-tuple, + trailing-newlines, trailing-whitespace, + truncated-format-string, + try-except-raise, + typevar-double-variance, + typevar-name-incorrect-variance, + typevar-name-mismatch, + unbalanced-dict-unpacking, +# unbalanced-tuple-unpacking, + undefined-all-variable, +# undefined-loop-variable, + undefined-variable, + unexpected-keyword-arg, + unexpected-line-ending-format, + unexpected-special-method-signature, +# ungrouped-imports, + unhashable-member, +# unidiomatic-typecheck, + unknown-option-value, +# unnecessary-comprehension, + unnecessary-dict-index-lookup, + unnecessary-direct-lambda-call, +# unnecessary-dunder-call, + unnecessary-ellipsis, +# unnecessary-lambda, +# unnecessary-lambda-assignment, + unnecessary-list-index-lookup, +# unnecessary-negation, +# unnecessary-pass, + unnecessary-semicolon, + unpacking-non-sequence, + unreachable, + unrecognized-inline-option, +# unspecified-encoding, +# unsubscriptable-object, + unsupported-assignment-operation, + unsupported-binary-operation, + unsupported-delete-operation, + unsupported-membership-test, +# unused-argument, + unused-format-string-argument, + unused-format-string-key, +# unused-import, + unused-private-member, unused-variable, + unused-wildcard-import, +# use-a-generator, +# use-dict-literal, +# use-implicit-booleaness-not-comparison, +# use-implicit-booleaness-not-comparison-to-string, +# use-implicit-booleaness-not-comparison-to-zero, +# use-implicit-booleaness-not-len, +# use-list-literal, + use-maxsplit-arg, + use-sequence-for-iteration, +# use-symbolic-message-instead, +# use-yield-from, +# used-before-assignment, + used-prior-global-declaration, + useless-else-on-loop, + useless-import-alias, +# useless-object-inheritance, + useless-option-value, +# useless-parent-delegation, + useless-return, +# useless-suppression, + useless-with-lock, + using-assignment-expression-in-unsupported-version, + using-constant-test, + using-exception-groups-in-unsupported-version, + using-f-string-in-unsupported-version, + using-final-decorator-in-unsupported-version, + using-generic-type-syntax-in-unsupported-version, + using-positional-only-args-in-unsupported-version, + wildcard-import, + wrong-exception-operation, wrong-import-order, wrong-import-position, + wrong-spelling-in-comment, + wrong-spelling-in-docstring, + yield-inside-async-function, yield-outside-function -# Ignore long lines containing urls or pylint directives. -ignore-long-lines=^(.*#\w*pylint: disable.*|\s*(# )??)$ + +[METHOD_ARGS] + +# List of qualified names (i.e., library.method) which require a timeout +# parameter e.g. 'requests.api.get,requests.api.post' +timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +#notes=FIXME, +# TODO + +# Regular expression of note tags to take in consideration. +notes-rgx= + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=sys.exit,argparse.parse_error + +# Let 'consider-using-join' be raised when the separator to join on would be +# non-empty (resulting in expected fixes of the type: ``"- " + " - +# ".join(items)``) +suggest-join-with-non-empty-separator=yes + + +[REPORTS] + +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'fatal', 'error', 'warning', 'refactor', +# 'convention', and 'info' which contain the number of messages in each +# category, as well as 'statement' which is the total number of statements +# analyzed. This score is used by the global evaluation report (RP0004). +evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details. +msg-template= + +# Set the output format. Available formats are: text, parseable, colorized, +# json2 (improved json format), json (old json format) and msvs (visual +# studio). You can also give a reporter class, e.g. +# mypackage.mymodule.MyReporterClass. +#output-format= + +# Tells whether to display a full report or only the messages. +reports=no + +# Activate the evaluation score. +score=no + + +[SIMILARITIES] + +# Comments are removed from the similarity computation +ignore-comments=yes + +# Docstrings are removed from the similarity computation +ignore-docstrings=yes + +# Imports are removed from the similarity computation +ignore-imports=yes + +# Signatures are removed from the similarity computation +ignore-signatures=yes + +# Minimum lines number of a similarity. +min-similarity-lines=100 + + +[SPELLING] + +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=4 + +# Spelling dictionary name. No available dictionaries : You need to install +# both the python package and the system dependency for enchant to work. +spelling-dict= + +# List of comma separated words that should be considered directives if they +# appear at the beginning of a comment and should not be checked. +spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy: + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains the private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to the private dictionary (see the +# --spelling-private-dict-file option) instead of raising a message. +spelling-store-unknown-words=no + + +[STRING] + +# This flag controls whether inconsistent-quotes generates a warning when the +# character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=no + +# This flag controls whether the implicit-str-concat should generate a warning +# on implicit string concatenation in sequences defined over several lines. +check-str-concat-over-line-jumps=no + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of symbolic message names to ignore for Mixin members. +ignored-checks-for-mixins=no-member, + not-async-context-manager, + not-context-manager, + attribute-defined-outside-init + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + +# Regex pattern to define which classes are considered mixins. +mixin-class-rgx=.*[Mm]ixin + +# List of decorators that change the signature of a decorated function. +signature-mutators= + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of names allowed to shadow builtins +allowed-redefined-builtins= + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb + +# A regular expression matching the name of dummy variables (i.e. expected to +# not be used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=yes + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io diff --git a/dev_tools/conf/mypy.ini b/dev_tools/conf/mypy.ini index fb7364df4..bb4150476 100644 --- a/dev_tools/conf/mypy.ini +++ b/dev_tools/conf/mypy.ini @@ -1,16 +1,25 @@ [mypy] +implicit_optional = True + +# TODO: this is temporary for 1.7.0 release. Remove this & fix the errors. +ignore_errors = True [mypy-__main__] follow_imports = silent -ignore_missing_imports = true +ignore_missing_imports = True # 3rd-party libs for which we don't have stubs -[mypy-apiclient.*,numpy.*,pytest.*,scipy.*,,setuptools.*,_pytest.*] +[mypy-apiclient.*,numpy.*,pytest.*,scipy.*,,_pytest.*,h5py,pyscf.*,pubchempy,pybtas,absl,tensorflow_docs] follow_imports = silent -ignore_missing_imports = true +ignore_missing_imports = True -# Adding "sympy.* or mypy-sympy to the above list (3rd-party libs for which we don't have stubs) doesn't ignore "cannot find module 'sympy' error +# Adding "sympy.* or mypy-sympy to the above list (3rd-party libs for which we +# don't have stubs) doesn't ignore "cannot find module 'sympy' error [mypy-sympy.*] ignore_missing_imports = True +[mypy-tensorflow_docs.*] +ignore_missing_imports = True +[mypy-deprecation] +follow_untyped_imports = True diff --git a/dev_tools/requirements/deps/format.txt b/dev_tools/requirements/deps/format.txt index 8843cb32b..2ed78c80e 100644 --- a/dev_tools/requirements/deps/format.txt +++ b/dev_tools/requirements/deps/format.txt @@ -1,2 +1,2 @@ # Make sure this matches cirq/dev_tools/requirements/deps/format.txt -black==24.3.0 +black diff --git a/dev_tools/requirements/deps/mypy.txt b/dev_tools/requirements/deps/mypy.txt index 52fb9f771..36826aaae 100644 --- a/dev_tools/requirements/deps/mypy.txt +++ b/dev_tools/requirements/deps/mypy.txt @@ -1 +1,6 @@ -mypy~=0.782.0 \ No newline at end of file +mypy + +pandas-stubs +types-requests +types-setuptools +types-networkx diff --git a/dev_tools/requirements/deps/pip-tools.txt b/dev_tools/requirements/deps/pip-tools.txt index 6282d24e2..2c2a9f384 100644 --- a/dev_tools/requirements/deps/pip-tools.txt +++ b/dev_tools/requirements/deps/pip-tools.txt @@ -1 +1 @@ -pip-tools>=7.0 +pip-tools diff --git a/dev_tools/requirements/deps/pylint.txt b/dev_tools/requirements/deps/pylint.txt index 1add38037..3ff668adc 100644 --- a/dev_tools/requirements/deps/pylint.txt +++ b/dev_tools/requirements/deps/pylint.txt @@ -1,2 +1,5 @@ -pylint~=2.15.6 +pylint~=3.3 + +-r resource_estimates_runtime.txt +-r pytest.txt diff --git a/dev_tools/requirements/deps/resource_estimates_runtime.txt b/dev_tools/requirements/deps/resource_estimates_runtime.txt index e48b771e9..b38282f66 100644 --- a/dev_tools/requirements/deps/resource_estimates_runtime.txt +++ b/dev_tools/requirements/deps/resource_estimates_runtime.txt @@ -1,4 +1,4 @@ pyscf -jax -jaxlib -ase \ No newline at end of file +jax~=0.4.38 +jaxlib~=0.4.38 +ase diff --git a/dev_tools/requirements/deps/runtime.txt b/dev_tools/requirements/deps/runtime.txt index 9e675526a..3df7a0ec1 100644 --- a/dev_tools/requirements/deps/runtime.txt +++ b/dev_tools/requirements/deps/runtime.txt @@ -1,11 +1,11 @@ -cirq-core~=1.0 +cirq-core deprecation -h5py>=2.8 +h5py>=3.10.0 networkx -numpy>=1.11.0 +numpy>=1.24,<2.0 pubchempy -requests>=2.18 +requests~=2.32.2 -scipy>=1.1.0 +scipy>=1.10,<1.14 sympy diff --git a/dev_tools/requirements/envs/dev.env.txt b/dev_tools/requirements/envs/dev.env.txt index 90abb769f..3d5f3b512 100644 --- a/dev_tools/requirements/envs/dev.env.txt +++ b/dev_tools/requirements/envs/dev.env.txt @@ -4,97 +4,98 @@ # # pip-compile --output-file=envs/dev.env.txt deps/format.txt deps/mypy.txt deps/pip-tools.txt deps/pylint.txt deps/pytest.txt deps/resource_estimates_runtime.txt deps/runtime.txt # -ase==3.22.1 +ase==3.24.0 # via -r deps/resource_estimates_runtime.txt -astroid==2.13.5 +astroid==3.3.8 # via pylint -attrs==23.2.0 +attrs==25.1.0 # via + # cirq-core # jsonschema # referencing -black==23.3.0 +black==25.1.0 # via -r deps/format.txt -build==1.0.3 +build==1.2.2.post1 # via pip-tools -certifi==2024.7.4 +certifi==2025.1.31 # via requests -charset-normalizer==3.3.2 +charset-normalizer==3.4.1 # via requests -cirq-core==1.3.0 +cirq-core==1.4.1 # via -r deps/runtime.txt -click==8.1.7 +click==8.1.8 # via # black # pip-tools -contourpy==1.2.0 +contourpy==1.3.1 # via matplotlib -coverage[toml]==7.4.0 +coverage[toml]==7.6.10 # via pytest-cov cycler==0.12.1 # via matplotlib deprecation==2.1.0 # via -r deps/runtime.txt -dill==0.3.7 +dill==0.3.9 # via pylint duet==0.2.9 # via cirq-core -exceptiongroup==1.2.0 +exceptiongroup==1.2.2 # via pytest -execnet==2.0.2 +execnet==2.1.1 # via pytest-xdist -fastjsonschema==2.19.1 +fastjsonschema==2.21.1 # via nbformat -fonttools==4.47.2 +fonttools==4.55.8 # via matplotlib -h5py==3.10.0 +h5py==3.12.1 # via # -r deps/runtime.txt # pyscf -idna==3.7 +idna==3.10 # via requests iniconfig==2.0.0 # via pytest -isort==5.13.2 +isort==6.0.0 # via pylint -jax==0.4.31 - # via -r deps/resource_estimates_runtime.txt -jaxlib==0.4.31 +jax==0.4.38 # via -r deps/resource_estimates_runtime.txt -jsonschema==4.21.0 +jaxlib==0.4.38 + # via + # -r deps/resource_estimates_runtime.txt + # jax +jsonschema==4.23.0 # via nbformat -jsonschema-specifications==2023.12.1 +jsonschema-specifications==2024.10.1 # via jsonschema -jupyter-core==5.7.1 +jupyter-core==5.7.2 # via nbformat -kiwisolver==1.4.5 +kiwisolver==1.4.8 # via matplotlib -lazy-object-proxy==1.10.0 - # via astroid -matplotlib==3.8.2 +matplotlib==3.10.0 # via # ase # cirq-core mccabe==0.7.0 # via pylint -ml-dtypes==0.3.2 +ml-dtypes==0.5.1 # via # jax # jaxlib mpmath==1.3.0 # via sympy -mypy==0.782 +mypy==1.14.1 # via -r deps/mypy.txt -mypy-extensions==0.4.4 +mypy-extensions==1.0.0 # via # black # mypy -nbformat==5.9.2 +nbformat==5.10.4 # via -r deps/pytest.txt -networkx==3.2.1 +networkx==3.4.2 # via # -r deps/runtime.txt # cirq-core -numpy==1.26.3 +numpy==1.26.4 # via # -r deps/runtime.txt # ase @@ -105,73 +106,78 @@ numpy==1.26.3 # jaxlib # matplotlib # ml-dtypes - # opt-einsum # pandas + # pandas-stubs # pyscf # scipy -opt-einsum==3.3.0 + # types-networkx +opt-einsum==3.4.0 # via jax -packaging==23.2 +packaging==24.2 # via # black # build # deprecation # matplotlib # pytest -pandas==2.1.4 +pandas==2.2.3 # via cirq-core +pandas-stubs==2.2.3.241126 + # via -r deps/mypy.txt pathspec==0.12.1 # via black -pillow==10.3.0 +pillow==11.1.0 # via matplotlib -pip-tools==7.3.0 +pip-tools==7.4.1 # via -r deps/pip-tools.txt -platformdirs==4.1.0 +platformdirs==4.3.6 # via # black # jupyter-core # pylint -pluggy==1.3.0 +pluggy==1.5.0 # via pytest pubchempy==1.0.4 # via -r deps/runtime.txt -pylint==2.15.10 +pylint==3.3.4 # via -r deps/pylint.txt -pyparsing==3.1.1 +pyparsing==3.2.1 # via matplotlib -pyproject-hooks==1.0.0 - # via build -pyscf==2.4.0 +pyproject-hooks==1.2.0 + # via + # build + # pip-tools +pyscf==2.8.0 # via -r deps/resource_estimates_runtime.txt -pytest==7.4.4 +pytest==8.3.4 # via # -r deps/pytest.txt # pytest-asyncio # pytest-cov # pytest-xdist -pytest-asyncio==0.23.3 +pytest-asyncio==0.25.3 # via -r deps/pytest.txt -pytest-cov==4.1.0 +pytest-cov==6.0.0 # via -r deps/pytest.txt -pytest-xdist==3.5.0 +pytest-xdist==3.6.1 # via -r deps/pytest.txt -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via # matplotlib # pandas -pytz==2023.3.post1 +pytz==2025.1 # via pandas -referencing==0.32.1 +referencing==0.36.2 # via # jsonschema # jsonschema-specifications -requests==2.32.0 +requests==2.32.3 # via -r deps/runtime.txt -rpds-py==0.17.1 +rpds-py==0.22.3 # via # jsonschema # referencing -scipy==1.11.4 +scipy==1.13.1 # via # -r deps/runtime.txt # ase @@ -179,46 +185,54 @@ scipy==1.11.4 # jax # jaxlib # pyscf -six==1.16.0 +six==1.17.0 # via python-dateutil sortedcontainers==2.4.0 # via cirq-core -sympy==1.12 +sympy==1.13.3 # via # -r deps/runtime.txt # cirq-core -tomli==2.0.1 +tomli==2.2.1 # via # black # build # coverage + # mypy # pip-tools # pylint - # pyproject-hooks # pytest -tomlkit==0.12.3 +tomlkit==0.13.2 # via pylint -tqdm==4.66.3 +tqdm==4.67.1 # via cirq-core -traitlets==5.14.1 +traitlets==5.14.3 # via # jupyter-core # nbformat -typed-ast==1.4.3 - # via mypy -typing-extensions==4.9.0 +types-networkx==3.4.2.20241227 + # via -r deps/mypy.txt +types-pytz==2024.2.0.20241221 + # via pandas-stubs +types-requests==2.32.0.20241016 + # via -r deps/mypy.txt +types-setuptools==75.8.0.20250110 + # via -r deps/mypy.txt +typing-extensions==4.12.2 # via # astroid + # black # cirq-core # mypy -tzdata==2023.4 + # referencing +tzdata==2025.1 # via pandas -urllib3==2.2.2 - # via requests -wheel==0.42.0 +urllib3==2.3.0 + # via + # requests + # types-requests +wheel==0.45.1 # via pip-tools -wrapt==1.16.0 - # via astroid # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/dev_tools/requirements/envs/format.env.txt b/dev_tools/requirements/envs/format.env.txt index c4ad34dd9..d0e41f081 100644 --- a/dev_tools/requirements/envs/format.env.txt +++ b/dev_tools/requirements/envs/format.env.txt @@ -4,27 +4,31 @@ # # pip-compile --constraint=envs/dev.env.txt --output-file=envs/format.env.txt deps/format.txt deps/runtime.txt # -black==23.3.0 +attrs==25.1.0 + # via + # -c envs/dev.env.txt + # cirq-core +black==25.1.0 # via # -c envs/dev.env.txt # -r deps/format.txt -certifi==2024.7.4 +certifi==2025.1.31 # via # -c envs/dev.env.txt # requests -charset-normalizer==3.3.2 +charset-normalizer==3.4.1 # via # -c envs/dev.env.txt # requests -cirq-core==1.3.0 +cirq-core==1.4.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt -click==8.1.7 +click==8.1.8 # via # -c envs/dev.env.txt # black -contourpy==1.2.0 +contourpy==1.3.1 # via # -c envs/dev.env.txt # matplotlib @@ -40,23 +44,23 @@ duet==0.2.9 # via # -c envs/dev.env.txt # cirq-core -fonttools==4.47.2 +fonttools==4.55.8 # via # -c envs/dev.env.txt # matplotlib -h5py==3.10.0 +h5py==3.12.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt -idna==3.7 +idna==3.10 # via # -c envs/dev.env.txt # requests -kiwisolver==1.4.5 +kiwisolver==1.4.8 # via # -c envs/dev.env.txt # matplotlib -matplotlib==3.8.2 +matplotlib==3.10.0 # via # -c envs/dev.env.txt # cirq-core @@ -64,16 +68,16 @@ mpmath==1.3.0 # via # -c envs/dev.env.txt # sympy -mypy-extensions==0.4.4 +mypy-extensions==1.0.0 # via # -c envs/dev.env.txt # black -networkx==3.2.1 +networkx==3.4.2 # via # -c envs/dev.env.txt # -r deps/runtime.txt # cirq-core -numpy==1.26.3 +numpy==1.26.4 # via # -c envs/dev.env.txt # -r deps/runtime.txt @@ -83,13 +87,13 @@ numpy==1.26.3 # matplotlib # pandas # scipy -packaging==23.2 +packaging==24.2 # via # -c envs/dev.env.txt # black # deprecation # matplotlib -pandas==2.1.4 +pandas==2.2.3 # via # -c envs/dev.env.txt # cirq-core @@ -97,11 +101,11 @@ pathspec==0.12.1 # via # -c envs/dev.env.txt # black -pillow==10.3.0 +pillow==11.1.0 # via # -c envs/dev.env.txt # matplotlib -platformdirs==4.1.0 +platformdirs==4.3.6 # via # -c envs/dev.env.txt # black @@ -109,29 +113,29 @@ pubchempy==1.0.4 # via # -c envs/dev.env.txt # -r deps/runtime.txt -pyparsing==3.1.1 +pyparsing==3.2.1 # via # -c envs/dev.env.txt # matplotlib -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via # -c envs/dev.env.txt # matplotlib # pandas -pytz==2023.3.post1 +pytz==2025.1 # via # -c envs/dev.env.txt # pandas -requests==2.32.0 +requests==2.32.3 # via # -c envs/dev.env.txt # -r deps/runtime.txt -scipy==1.11.4 +scipy==1.13.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt # cirq-core -six==1.16.0 +six==1.17.0 # via # -c envs/dev.env.txt # python-dateutil @@ -139,28 +143,29 @@ sortedcontainers==2.4.0 # via # -c envs/dev.env.txt # cirq-core -sympy==1.12 +sympy==1.13.3 # via # -c envs/dev.env.txt # -r deps/runtime.txt # cirq-core -tomli==2.0.1 +tomli==2.2.1 # via # -c envs/dev.env.txt # black -tqdm==4.66.3 +tqdm==4.67.1 # via # -c envs/dev.env.txt # cirq-core -typing-extensions==4.9.0 +typing-extensions==4.12.2 # via # -c envs/dev.env.txt + # black # cirq-core -tzdata==2023.4 +tzdata==2025.1 # via # -c envs/dev.env.txt # pandas -urllib3==2.2.2 +urllib3==2.3.0 # via # -c envs/dev.env.txt # requests diff --git a/dev_tools/requirements/envs/mypy.env.txt b/dev_tools/requirements/envs/mypy.env.txt index 1d2927bea..a39230687 100644 --- a/dev_tools/requirements/envs/mypy.env.txt +++ b/dev_tools/requirements/envs/mypy.env.txt @@ -4,19 +4,23 @@ # # pip-compile --constraint=envs/dev.env.txt --output-file=envs/mypy.env.txt deps/mypy.txt deps/runtime.txt # -certifi==2024.7.4 +attrs==25.1.0 + # via + # -c envs/dev.env.txt + # cirq-core +certifi==2025.1.31 # via # -c envs/dev.env.txt # requests -charset-normalizer==3.3.2 +charset-normalizer==3.4.1 # via # -c envs/dev.env.txt # requests -cirq-core==1.3.0 +cirq-core==1.4.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt -contourpy==1.2.0 +contourpy==1.3.1 # via # -c envs/dev.env.txt # matplotlib @@ -32,23 +36,23 @@ duet==0.2.9 # via # -c envs/dev.env.txt # cirq-core -fonttools==4.47.2 +fonttools==4.55.8 # via # -c envs/dev.env.txt # matplotlib -h5py==3.10.0 +h5py==3.12.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt -idna==3.7 +idna==3.10 # via # -c envs/dev.env.txt # requests -kiwisolver==1.4.5 +kiwisolver==1.4.8 # via # -c envs/dev.env.txt # matplotlib -matplotlib==3.8.2 +matplotlib==3.10.0 # via # -c envs/dev.env.txt # cirq-core @@ -56,20 +60,20 @@ mpmath==1.3.0 # via # -c envs/dev.env.txt # sympy -mypy==0.782 +mypy==1.14.1 # via # -c envs/dev.env.txt # -r deps/mypy.txt -mypy-extensions==0.4.4 +mypy-extensions==1.0.0 # via # -c envs/dev.env.txt # mypy -networkx==3.2.1 +networkx==3.4.2 # via # -c envs/dev.env.txt # -r deps/runtime.txt # cirq-core -numpy==1.26.3 +numpy==1.26.4 # via # -c envs/dev.env.txt # -r deps/runtime.txt @@ -78,17 +82,23 @@ numpy==1.26.3 # h5py # matplotlib # pandas + # pandas-stubs # scipy -packaging==23.2 + # types-networkx +packaging==24.2 # via # -c envs/dev.env.txt # deprecation # matplotlib -pandas==2.1.4 +pandas==2.2.3 # via # -c envs/dev.env.txt # cirq-core -pillow==10.3.0 +pandas-stubs==2.2.3.241126 + # via + # -c envs/dev.env.txt + # -r deps/mypy.txt +pillow==11.1.0 # via # -c envs/dev.env.txt # matplotlib @@ -96,29 +106,29 @@ pubchempy==1.0.4 # via # -c envs/dev.env.txt # -r deps/runtime.txt -pyparsing==3.1.1 +pyparsing==3.2.1 # via # -c envs/dev.env.txt # matplotlib -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via # -c envs/dev.env.txt # matplotlib # pandas -pytz==2023.3.post1 +pytz==2025.1 # via # -c envs/dev.env.txt # pandas -requests==2.32.0 +requests==2.32.3 # via # -c envs/dev.env.txt # -r deps/runtime.txt -scipy==1.11.4 +scipy==1.13.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt # cirq-core -six==1.16.0 +six==1.17.0 # via # -c envs/dev.env.txt # python-dateutil @@ -126,29 +136,46 @@ sortedcontainers==2.4.0 # via # -c envs/dev.env.txt # cirq-core -sympy==1.12 +sympy==1.13.3 # via # -c envs/dev.env.txt # -r deps/runtime.txt # cirq-core -tqdm==4.66.3 +tomli==2.2.1 + # via + # -c envs/dev.env.txt + # mypy +tqdm==4.67.1 # via # -c envs/dev.env.txt # cirq-core -typed-ast==1.4.3 +types-networkx==3.4.2.20241227 # via # -c envs/dev.env.txt - # mypy -typing-extensions==4.9.0 + # -r deps/mypy.txt +types-pytz==2024.2.0.20241221 + # via + # -c envs/dev.env.txt + # pandas-stubs +types-requests==2.32.0.20241016 + # via + # -c envs/dev.env.txt + # -r deps/mypy.txt +types-setuptools==75.8.0.20250110 + # via + # -c envs/dev.env.txt + # -r deps/mypy.txt +typing-extensions==4.12.2 # via # -c envs/dev.env.txt # cirq-core # mypy -tzdata==2023.4 +tzdata==2025.1 # via # -c envs/dev.env.txt # pandas -urllib3==2.2.2 +urllib3==2.3.0 # via # -c envs/dev.env.txt # requests + # types-requests diff --git a/dev_tools/requirements/envs/pip-tools.env.txt b/dev_tools/requirements/envs/pip-tools.env.txt index eb5f0c5a4..484562e7e 100644 --- a/dev_tools/requirements/envs/pip-tools.env.txt +++ b/dev_tools/requirements/envs/pip-tools.env.txt @@ -4,33 +4,33 @@ # # pip-compile --constraint=envs/dev.env.txt --output-file=envs/pip-tools.env.txt deps/pip-tools.txt # -build==1.0.3 +build==1.2.2.post1 # via # -c envs/dev.env.txt # pip-tools -click==8.1.7 +click==8.1.8 # via # -c envs/dev.env.txt # pip-tools -packaging==23.2 +packaging==24.2 # via # -c envs/dev.env.txt # build -pip-tools==7.3.0 +pip-tools==7.4.1 # via # -c envs/dev.env.txt # -r deps/pip-tools.txt -pyproject-hooks==1.0.0 +pyproject-hooks==1.2.0 # via # -c envs/dev.env.txt # build -tomli==2.0.1 + # pip-tools +tomli==2.2.1 # via # -c envs/dev.env.txt # build # pip-tools - # pyproject-hooks -wheel==0.42.0 +wheel==0.45.1 # via # -c envs/dev.env.txt # pip-tools diff --git a/dev_tools/requirements/envs/pylint.env.txt b/dev_tools/requirements/envs/pylint.env.txt index 75044019d..6c8463633 100644 --- a/dev_tools/requirements/envs/pylint.env.txt +++ b/dev_tools/requirements/envs/pylint.env.txt @@ -4,26 +4,40 @@ # # pip-compile --constraint=envs/dev.env.txt --output-file=envs/pylint.env.txt deps/pylint.txt deps/runtime.txt # -astroid==2.13.5 +ase==3.24.0 + # via + # -c envs/dev.env.txt + # -r deps/resource_estimates_runtime.txt +astroid==3.3.8 # via # -c envs/dev.env.txt # pylint -certifi==2024.7.4 +attrs==25.1.0 + # via + # -c envs/dev.env.txt + # cirq-core + # jsonschema + # referencing +certifi==2025.1.31 # via # -c envs/dev.env.txt # requests -charset-normalizer==3.3.2 +charset-normalizer==3.4.1 # via # -c envs/dev.env.txt # requests -cirq-core==1.3.0 +cirq-core==1.4.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt -contourpy==1.2.0 +contourpy==1.3.1 # via # -c envs/dev.env.txt # matplotlib +coverage[toml]==7.6.10 + # via + # -c envs/dev.env.txt + # pytest-cov cycler==0.12.1 # via # -c envs/dev.env.txt @@ -32,7 +46,7 @@ deprecation==2.1.0 # via # -c envs/dev.env.txt # -r deps/runtime.txt -dill==0.3.7 +dill==0.3.9 # via # -c envs/dev.env.txt # pylint @@ -40,105 +54,201 @@ duet==0.2.9 # via # -c envs/dev.env.txt # cirq-core -fonttools==4.47.2 +exceptiongroup==1.2.2 + # via + # -c envs/dev.env.txt + # pytest +execnet==2.1.1 + # via + # -c envs/dev.env.txt + # pytest-xdist +fastjsonschema==2.21.1 + # via + # -c envs/dev.env.txt + # nbformat +fonttools==4.55.8 # via # -c envs/dev.env.txt # matplotlib -h5py==3.10.0 +h5py==3.12.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt -idna==3.7 + # pyscf +idna==3.10 # via # -c envs/dev.env.txt # requests -isort==5.13.2 +iniconfig==2.0.0 + # via + # -c envs/dev.env.txt + # pytest +isort==6.0.0 # via # -c envs/dev.env.txt # pylint -kiwisolver==1.4.5 +jax==0.4.38 # via # -c envs/dev.env.txt - # matplotlib -lazy-object-proxy==1.10.0 + # -r deps/resource_estimates_runtime.txt +jaxlib==0.4.38 # via # -c envs/dev.env.txt - # astroid -matplotlib==3.8.2 + # -r deps/resource_estimates_runtime.txt + # jax +jsonschema==4.23.0 + # via + # -c envs/dev.env.txt + # nbformat +jsonschema-specifications==2024.10.1 + # via + # -c envs/dev.env.txt + # jsonschema +jupyter-core==5.7.2 # via # -c envs/dev.env.txt + # nbformat +kiwisolver==1.4.8 + # via + # -c envs/dev.env.txt + # matplotlib +matplotlib==3.10.0 + # via + # -c envs/dev.env.txt + # ase # cirq-core mccabe==0.7.0 # via # -c envs/dev.env.txt # pylint +ml-dtypes==0.5.1 + # via + # -c envs/dev.env.txt + # jax + # jaxlib mpmath==1.3.0 # via # -c envs/dev.env.txt # sympy -networkx==3.2.1 +nbformat==5.10.4 + # via + # -c envs/dev.env.txt + # -r deps/pytest.txt +networkx==3.4.2 # via # -c envs/dev.env.txt # -r deps/runtime.txt # cirq-core -numpy==1.26.3 +numpy==1.26.4 # via # -c envs/dev.env.txt # -r deps/runtime.txt + # ase # cirq-core # contourpy # h5py + # jax + # jaxlib # matplotlib + # ml-dtypes # pandas + # pyscf # scipy -packaging==23.2 +opt-einsum==3.4.0 + # via + # -c envs/dev.env.txt + # jax +packaging==24.2 # via # -c envs/dev.env.txt # deprecation # matplotlib -pandas==2.1.4 + # pytest +pandas==2.2.3 # via # -c envs/dev.env.txt # cirq-core -pillow==10.3.0 +pillow==11.1.0 # via # -c envs/dev.env.txt # matplotlib -platformdirs==4.1.0 +platformdirs==4.3.6 # via # -c envs/dev.env.txt + # jupyter-core # pylint +pluggy==1.5.0 + # via + # -c envs/dev.env.txt + # pytest pubchempy==1.0.4 # via # -c envs/dev.env.txt # -r deps/runtime.txt -pylint==2.15.10 +pylint==3.3.4 # via # -c envs/dev.env.txt # -r deps/pylint.txt -pyparsing==3.1.1 +pyparsing==3.2.1 # via # -c envs/dev.env.txt # matplotlib -python-dateutil==2.8.2 +pyscf==2.8.0 + # via + # -c envs/dev.env.txt + # -r deps/resource_estimates_runtime.txt +pytest==8.3.4 + # via + # -c envs/dev.env.txt + # -r deps/pytest.txt + # pytest-asyncio + # pytest-cov + # pytest-xdist +pytest-asyncio==0.25.3 + # via + # -c envs/dev.env.txt + # -r deps/pytest.txt +pytest-cov==6.0.0 + # via + # -c envs/dev.env.txt + # -r deps/pytest.txt +pytest-xdist==3.6.1 + # via + # -c envs/dev.env.txt + # -r deps/pytest.txt +python-dateutil==2.9.0.post0 # via # -c envs/dev.env.txt # matplotlib # pandas -pytz==2023.3.post1 +pytz==2025.1 # via # -c envs/dev.env.txt # pandas -requests==2.32.0 +referencing==0.36.2 + # via + # -c envs/dev.env.txt + # jsonschema + # jsonschema-specifications +requests==2.32.3 # via # -c envs/dev.env.txt # -r deps/runtime.txt -scipy==1.11.4 +rpds-py==0.22.3 + # via + # -c envs/dev.env.txt + # jsonschema + # referencing +scipy==1.13.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt + # ase # cirq-core -six==1.16.0 + # jax + # jaxlib + # pyscf +six==1.17.0 # via # -c envs/dev.env.txt # python-dateutil @@ -146,37 +256,44 @@ sortedcontainers==2.4.0 # via # -c envs/dev.env.txt # cirq-core -sympy==1.12 +sympy==1.13.3 # via # -c envs/dev.env.txt # -r deps/runtime.txt # cirq-core -tomli==2.0.1 +tomli==2.2.1 # via # -c envs/dev.env.txt + # coverage # pylint -tomlkit==0.12.3 + # pytest +tomlkit==0.13.2 # via # -c envs/dev.env.txt # pylint -tqdm==4.66.3 +tqdm==4.67.1 # via # -c envs/dev.env.txt # cirq-core -typing-extensions==4.9.0 +traitlets==5.14.3 + # via + # -c envs/dev.env.txt + # jupyter-core + # nbformat +typing-extensions==4.12.2 # via # -c envs/dev.env.txt # astroid # cirq-core -tzdata==2023.4 + # referencing +tzdata==2025.1 # via # -c envs/dev.env.txt # pandas -urllib3==2.2.2 +urllib3==2.3.0 # via # -c envs/dev.env.txt # requests -wrapt==1.16.0 - # via - # -c envs/dev.env.txt - # astroid + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/dev_tools/requirements/envs/pytest-extra.env.txt b/dev_tools/requirements/envs/pytest-extra.env.txt index 8f424118e..4cd0d9e8b 100644 --- a/dev_tools/requirements/envs/pytest-extra.env.txt +++ b/dev_tools/requirements/envs/pytest-extra.env.txt @@ -4,32 +4,33 @@ # # pip-compile --constraint=envs/dev.env.txt --output-file=envs/pytest-extra.env.txt deps/pytest.txt deps/resource_estimates_runtime.txt deps/runtime.txt # -ase==3.22.1 +ase==3.24.0 # via # -c envs/dev.env.txt # -r deps/resource_estimates_runtime.txt -attrs==23.2.0 +attrs==25.1.0 # via # -c envs/dev.env.txt + # cirq-core # jsonschema # referencing -certifi==2024.7.4 +certifi==2025.1.31 # via # -c envs/dev.env.txt # requests -charset-normalizer==3.3.2 +charset-normalizer==3.4.1 # via # -c envs/dev.env.txt # requests -cirq-core==1.3.0 +cirq-core==1.4.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt -contourpy==1.2.0 +contourpy==1.3.1 # via # -c envs/dev.env.txt # matplotlib -coverage[toml]==7.4.0 +coverage[toml]==7.6.10 # via # -c envs/dev.env.txt # pytest-cov @@ -45,28 +46,28 @@ duet==0.2.9 # via # -c envs/dev.env.txt # cirq-core -exceptiongroup==1.2.0 +exceptiongroup==1.2.2 # via # -c envs/dev.env.txt # pytest -execnet==2.0.2 +execnet==2.1.1 # via # -c envs/dev.env.txt # pytest-xdist -fastjsonschema==2.19.1 +fastjsonschema==2.21.1 # via # -c envs/dev.env.txt # nbformat -fonttools==4.47.2 +fonttools==4.55.8 # via # -c envs/dev.env.txt # matplotlib -h5py==3.10.0 +h5py==3.12.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt # pyscf -idna==3.7 +idna==3.10 # via # -c envs/dev.env.txt # requests @@ -74,36 +75,37 @@ iniconfig==2.0.0 # via # -c envs/dev.env.txt # pytest -jax==0.4.31 +jax==0.4.38 # via # -c envs/dev.env.txt # -r deps/resource_estimates_runtime.txt -jaxlib==0.4.31 +jaxlib==0.4.38 # via # -c envs/dev.env.txt # -r deps/resource_estimates_runtime.txt -jsonschema==4.21.0 + # jax +jsonschema==4.23.0 # via # -c envs/dev.env.txt # nbformat -jsonschema-specifications==2023.12.1 +jsonschema-specifications==2024.10.1 # via # -c envs/dev.env.txt # jsonschema -jupyter-core==5.7.1 +jupyter-core==5.7.2 # via # -c envs/dev.env.txt # nbformat -kiwisolver==1.4.5 +kiwisolver==1.4.8 # via # -c envs/dev.env.txt # matplotlib -matplotlib==3.8.2 +matplotlib==3.10.0 # via # -c envs/dev.env.txt # ase # cirq-core -ml-dtypes==0.3.2 +ml-dtypes==0.5.1 # via # -c envs/dev.env.txt # jax @@ -112,16 +114,16 @@ mpmath==1.3.0 # via # -c envs/dev.env.txt # sympy -nbformat==5.9.2 +nbformat==5.10.4 # via # -c envs/dev.env.txt # -r deps/pytest.txt -networkx==3.2.1 +networkx==3.4.2 # via # -c envs/dev.env.txt # -r deps/runtime.txt # cirq-core -numpy==1.26.3 +numpy==1.26.4 # via # -c envs/dev.env.txt # -r deps/runtime.txt @@ -133,33 +135,32 @@ numpy==1.26.3 # jaxlib # matplotlib # ml-dtypes - # opt-einsum # pandas # pyscf # scipy -opt-einsum==3.3.0 +opt-einsum==3.4.0 # via # -c envs/dev.env.txt # jax -packaging==23.2 +packaging==24.2 # via # -c envs/dev.env.txt # deprecation # matplotlib # pytest -pandas==2.1.4 +pandas==2.2.3 # via # -c envs/dev.env.txt # cirq-core -pillow==10.3.0 +pillow==11.1.0 # via # -c envs/dev.env.txt # matplotlib -platformdirs==4.1.0 +platformdirs==4.3.6 # via # -c envs/dev.env.txt # jupyter-core -pluggy==1.3.0 +pluggy==1.5.0 # via # -c envs/dev.env.txt # pytest @@ -167,57 +168,57 @@ pubchempy==1.0.4 # via # -c envs/dev.env.txt # -r deps/runtime.txt -pyparsing==3.1.1 +pyparsing==3.2.1 # via # -c envs/dev.env.txt # matplotlib -pyscf==2.4.0 +pyscf==2.8.0 # via # -c envs/dev.env.txt # -r deps/resource_estimates_runtime.txt -pytest==7.4.4 +pytest==8.3.4 # via # -c envs/dev.env.txt # -r deps/pytest.txt # pytest-asyncio # pytest-cov # pytest-xdist -pytest-asyncio==0.23.3 +pytest-asyncio==0.25.3 # via # -c envs/dev.env.txt # -r deps/pytest.txt -pytest-cov==4.1.0 +pytest-cov==6.0.0 # via # -c envs/dev.env.txt # -r deps/pytest.txt -pytest-xdist==3.5.0 +pytest-xdist==3.6.1 # via # -c envs/dev.env.txt # -r deps/pytest.txt -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via # -c envs/dev.env.txt # matplotlib # pandas -pytz==2023.3.post1 +pytz==2025.1 # via # -c envs/dev.env.txt # pandas -referencing==0.32.1 +referencing==0.36.2 # via # -c envs/dev.env.txt # jsonschema # jsonschema-specifications -requests==2.32.0 +requests==2.32.3 # via # -c envs/dev.env.txt # -r deps/runtime.txt -rpds-py==0.17.1 +rpds-py==0.22.3 # via # -c envs/dev.env.txt # jsonschema # referencing -scipy==1.11.4 +scipy==1.13.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt @@ -226,7 +227,7 @@ scipy==1.11.4 # jax # jaxlib # pyscf -six==1.16.0 +six==1.17.0 # via # -c envs/dev.env.txt # python-dateutil @@ -234,34 +235,35 @@ sortedcontainers==2.4.0 # via # -c envs/dev.env.txt # cirq-core -sympy==1.12 +sympy==1.13.3 # via # -c envs/dev.env.txt # -r deps/runtime.txt # cirq-core -tomli==2.0.1 +tomli==2.2.1 # via # -c envs/dev.env.txt # coverage # pytest -tqdm==4.66.3 +tqdm==4.67.1 # via # -c envs/dev.env.txt # cirq-core -traitlets==5.14.1 +traitlets==5.14.3 # via # -c envs/dev.env.txt # jupyter-core # nbformat -typing-extensions==4.9.0 +typing-extensions==4.12.2 # via # -c envs/dev.env.txt # cirq-core -tzdata==2023.4 + # referencing +tzdata==2025.1 # via # -c envs/dev.env.txt # pandas -urllib3==2.2.2 +urllib3==2.3.0 # via # -c envs/dev.env.txt # requests diff --git a/dev_tools/requirements/envs/pytest.env.txt b/dev_tools/requirements/envs/pytest.env.txt index 64142557c..9222bd7c3 100644 --- a/dev_tools/requirements/envs/pytest.env.txt +++ b/dev_tools/requirements/envs/pytest.env.txt @@ -4,28 +4,29 @@ # # pip-compile --constraint=envs/dev.env.txt --output-file=envs/pytest.env.txt deps/pytest.txt deps/runtime.txt # -attrs==23.2.0 +attrs==25.1.0 # via # -c envs/dev.env.txt + # cirq-core # jsonschema # referencing -certifi==2024.7.4 +certifi==2025.1.31 # via # -c envs/dev.env.txt # requests -charset-normalizer==3.3.2 +charset-normalizer==3.4.1 # via # -c envs/dev.env.txt # requests -cirq-core==1.3.0 +cirq-core==1.4.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt -contourpy==1.2.0 +contourpy==1.3.1 # via # -c envs/dev.env.txt # matplotlib -coverage[toml]==7.4.0 +coverage[toml]==7.6.10 # via # -c envs/dev.env.txt # pytest-cov @@ -41,27 +42,27 @@ duet==0.2.9 # via # -c envs/dev.env.txt # cirq-core -exceptiongroup==1.2.0 +exceptiongroup==1.2.2 # via # -c envs/dev.env.txt # pytest -execnet==2.0.2 +execnet==2.1.1 # via # -c envs/dev.env.txt # pytest-xdist -fastjsonschema==2.19.1 +fastjsonschema==2.21.1 # via # -c envs/dev.env.txt # nbformat -fonttools==4.47.2 +fonttools==4.55.8 # via # -c envs/dev.env.txt # matplotlib -h5py==3.10.0 +h5py==3.12.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt -idna==3.7 +idna==3.10 # via # -c envs/dev.env.txt # requests @@ -69,23 +70,23 @@ iniconfig==2.0.0 # via # -c envs/dev.env.txt # pytest -jsonschema==4.21.0 +jsonschema==4.23.0 # via # -c envs/dev.env.txt # nbformat -jsonschema-specifications==2023.12.1 +jsonschema-specifications==2024.10.1 # via # -c envs/dev.env.txt # jsonschema -jupyter-core==5.7.1 +jupyter-core==5.7.2 # via # -c envs/dev.env.txt # nbformat -kiwisolver==1.4.5 +kiwisolver==1.4.8 # via # -c envs/dev.env.txt # matplotlib -matplotlib==3.8.2 +matplotlib==3.10.0 # via # -c envs/dev.env.txt # cirq-core @@ -93,16 +94,16 @@ mpmath==1.3.0 # via # -c envs/dev.env.txt # sympy -nbformat==5.9.2 +nbformat==5.10.4 # via # -c envs/dev.env.txt # -r deps/pytest.txt -networkx==3.2.1 +networkx==3.4.2 # via # -c envs/dev.env.txt # -r deps/runtime.txt # cirq-core -numpy==1.26.3 +numpy==1.26.4 # via # -c envs/dev.env.txt # -r deps/runtime.txt @@ -112,25 +113,25 @@ numpy==1.26.3 # matplotlib # pandas # scipy -packaging==23.2 +packaging==24.2 # via # -c envs/dev.env.txt # deprecation # matplotlib # pytest -pandas==2.1.4 +pandas==2.2.3 # via # -c envs/dev.env.txt # cirq-core -pillow==10.3.0 +pillow==11.1.0 # via # -c envs/dev.env.txt # matplotlib -platformdirs==4.1.0 +platformdirs==4.3.6 # via # -c envs/dev.env.txt # jupyter-core -pluggy==1.3.0 +pluggy==1.5.0 # via # -c envs/dev.env.txt # pytest @@ -138,58 +139,58 @@ pubchempy==1.0.4 # via # -c envs/dev.env.txt # -r deps/runtime.txt -pyparsing==3.1.1 +pyparsing==3.2.1 # via # -c envs/dev.env.txt # matplotlib -pytest==7.4.4 +pytest==8.3.4 # via # -c envs/dev.env.txt # -r deps/pytest.txt # pytest-asyncio # pytest-cov # pytest-xdist -pytest-asyncio==0.23.3 +pytest-asyncio==0.25.3 # via # -c envs/dev.env.txt # -r deps/pytest.txt -pytest-cov==4.1.0 +pytest-cov==6.0.0 # via # -c envs/dev.env.txt # -r deps/pytest.txt -pytest-xdist==3.5.0 +pytest-xdist==3.6.1 # via # -c envs/dev.env.txt # -r deps/pytest.txt -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via # -c envs/dev.env.txt # matplotlib # pandas -pytz==2023.3.post1 +pytz==2025.1 # via # -c envs/dev.env.txt # pandas -referencing==0.32.1 +referencing==0.36.2 # via # -c envs/dev.env.txt # jsonschema # jsonschema-specifications -requests==2.32.0 +requests==2.32.3 # via # -c envs/dev.env.txt # -r deps/runtime.txt -rpds-py==0.17.1 +rpds-py==0.22.3 # via # -c envs/dev.env.txt # jsonschema # referencing -scipy==1.11.4 +scipy==1.13.1 # via # -c envs/dev.env.txt # -r deps/runtime.txt # cirq-core -six==1.16.0 +six==1.17.0 # via # -c envs/dev.env.txt # python-dateutil @@ -197,34 +198,35 @@ sortedcontainers==2.4.0 # via # -c envs/dev.env.txt # cirq-core -sympy==1.12 +sympy==1.13.3 # via # -c envs/dev.env.txt # -r deps/runtime.txt # cirq-core -tomli==2.0.1 +tomli==2.2.1 # via # -c envs/dev.env.txt # coverage # pytest -tqdm==4.66.3 +tqdm==4.67.1 # via # -c envs/dev.env.txt # cirq-core -traitlets==5.14.1 +traitlets==5.14.3 # via # -c envs/dev.env.txt # jupyter-core # nbformat -typing-extensions==4.9.0 +typing-extensions==4.12.2 # via # -c envs/dev.env.txt # cirq-core -tzdata==2023.4 + # referencing +tzdata==2025.1 # via # -c envs/dev.env.txt # pandas -urllib3==2.2.2 +urllib3==2.3.0 # via # -c envs/dev.env.txt # requests diff --git a/dev_tools/requirements/max_compat/dev.env.txt b/dev_tools/requirements/max_compat/dev.env.txt index 05c702463..41d534926 100644 --- a/dev_tools/requirements/max_compat/dev.env.txt +++ b/dev_tools/requirements/max_compat/dev.env.txt @@ -4,13 +4,13 @@ # # pip-compile --constraint=deps/oldest-versions.txt --output-file=max_compat/dev.env.txt deps/pytest.txt deps/runtime.txt # -attrs==23.2.0 +attrs==25.1.0 # via # jsonschema # referencing -certifi==2023.11.17 +certifi==2025.1.31 # via requests -charset-normalizer==3.3.2 +charset-normalizer==3.4.1 # via requests cirq-core==1.0.0 # via @@ -18,7 +18,7 @@ cirq-core==1.0.0 # -r deps/runtime.txt contourpy==1.1.1 # via matplotlib -coverage[toml]==7.4.0 +coverage[toml]==7.6.1 # via pytest-cov cycler==0.12.1 # via matplotlib @@ -26,38 +26,38 @@ deprecation==2.1.0 # via -r deps/runtime.txt duet==0.2.8 # via cirq-core -exceptiongroup==1.2.0 +exceptiongroup==1.2.2 # via pytest -execnet==2.0.2 +execnet==2.1.1 # via pytest-xdist -fastjsonschema==2.19.1 +fastjsonschema==2.21.1 # via nbformat -fonttools==4.47.2 +fonttools==4.55.8 # via matplotlib -h5py==3.10.0 +h5py==3.11.0 # via -r deps/runtime.txt -idna==3.7 +idna==3.10 # via requests -importlib-resources==6.1.1 +importlib-resources==6.4.5 # via # jsonschema # jsonschema-specifications # matplotlib iniconfig==2.0.0 # via pytest -jsonschema==4.21.0 +jsonschema==4.23.0 # via nbformat jsonschema-specifications==2023.12.1 # via jsonschema -jupyter-core==5.7.1 +jupyter-core==5.7.2 # via nbformat -kiwisolver==1.4.5 +kiwisolver==1.4.7 # via matplotlib -matplotlib==3.7.4 +matplotlib==3.7.5 # via cirq-core mpmath==1.3.0 # via sympy -nbformat==5.9.2 +nbformat==5.10.4 # via -r deps/pytest.txt networkx==2.8.8 # via @@ -72,50 +72,50 @@ numpy==1.24.4 # matplotlib # pandas # scipy -packaging==23.2 +packaging==24.2 # via # deprecation # matplotlib # pytest pandas==2.0.3 # via cirq-core -pillow==10.3.0 +pillow==10.4.0 # via matplotlib pkgutil-resolve-name==1.3.10 # via jsonschema -platformdirs==4.1.0 +platformdirs==4.3.6 # via jupyter-core -pluggy==1.3.0 +pluggy==1.5.0 # via pytest pubchempy==1.0.4 # via -r deps/runtime.txt -pyparsing==3.1.1 +pyparsing==3.1.4 # via matplotlib -pytest==7.4.4 +pytest==8.3.4 # via # -r deps/pytest.txt # pytest-asyncio # pytest-cov # pytest-xdist -pytest-asyncio==0.23.3 +pytest-asyncio==0.24.0 # via -r deps/pytest.txt -pytest-cov==4.1.0 +pytest-cov==5.0.0 # via -r deps/pytest.txt -pytest-xdist==3.5.0 +pytest-xdist==3.6.1 # via -r deps/pytest.txt -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via # matplotlib # pandas -pytz==2023.3.post1 +pytz==2025.1 # via pandas -referencing==0.32.1 +referencing==0.35.1 # via # jsonschema # jsonschema-specifications -requests==2.32.2 +requests==2.32.3 # via -r deps/runtime.txt -rpds-py==0.17.1 +rpds-py==0.20.1 # via # jsonschema # referencing @@ -123,29 +123,29 @@ scipy==1.10.1 # via # -r deps/runtime.txt # cirq-core -six==1.16.0 +six==1.17.0 # via python-dateutil sortedcontainers==2.4.0 # via cirq-core -sympy==1.12 +sympy==1.13.3 # via # -r deps/runtime.txt # cirq-core -tomli==2.0.1 +tomli==2.2.1 # via # coverage # pytest -tqdm==4.66.3 +tqdm==4.67.1 # via cirq-core -traitlets==5.14.1 +traitlets==5.14.3 # via # jupyter-core # nbformat -typing-extensions==4.9.0 +typing-extensions==4.12.2 # via cirq-core -tzdata==2023.4 +tzdata==2025.1 # via pandas -urllib3==2.2.2 +urllib3==2.2.3 # via requests -zipp==3.19.1 +zipp==3.20.2 # via importlib-resources diff --git a/dev_tools/requirements/max_compat/pytest-max-compat.env.txt b/dev_tools/requirements/max_compat/pytest-max-compat.env.txt index 06b3dc622..38ded985e 100644 --- a/dev_tools/requirements/max_compat/pytest-max-compat.env.txt +++ b/dev_tools/requirements/max_compat/pytest-max-compat.env.txt @@ -4,16 +4,16 @@ # # pip-compile --constraint=deps/oldest-versions.txt --constraint=max_compat/dev.env.txt --output-file=max_compat/pytest-max-compat.env.txt deps/pytest.txt deps/runtime.txt # -attrs==23.2.0 +attrs==25.1.0 # via # -c max_compat/dev.env.txt # jsonschema # referencing -certifi==2023.11.17 +certifi==2025.1.31 # via # -c max_compat/dev.env.txt # requests -charset-normalizer==3.3.2 +charset-normalizer==3.4.1 # via # -c max_compat/dev.env.txt # requests @@ -26,7 +26,7 @@ contourpy==1.1.1 # via # -c max_compat/dev.env.txt # matplotlib -coverage[toml]==7.4.0 +coverage[toml]==7.6.1 # via # -c max_compat/dev.env.txt # pytest-cov @@ -42,31 +42,31 @@ duet==0.2.8 # via # -c max_compat/dev.env.txt # cirq-core -exceptiongroup==1.2.0 +exceptiongroup==1.2.2 # via # -c max_compat/dev.env.txt # pytest -execnet==2.0.2 +execnet==2.1.1 # via # -c max_compat/dev.env.txt # pytest-xdist -fastjsonschema==2.19.1 +fastjsonschema==2.21.1 # via # -c max_compat/dev.env.txt # nbformat -fonttools==4.47.2 +fonttools==4.55.8 # via # -c max_compat/dev.env.txt # matplotlib -h5py==3.10.0 +h5py==3.11.0 # via # -c max_compat/dev.env.txt # -r deps/runtime.txt -idna==3.7 +idna==3.10 # via # -c max_compat/dev.env.txt # requests -importlib-resources==6.1.1 +importlib-resources==6.4.5 # via # -c max_compat/dev.env.txt # jsonschema @@ -76,7 +76,7 @@ iniconfig==2.0.0 # via # -c max_compat/dev.env.txt # pytest -jsonschema==4.21.0 +jsonschema==4.23.0 # via # -c max_compat/dev.env.txt # nbformat @@ -84,15 +84,15 @@ jsonschema-specifications==2023.12.1 # via # -c max_compat/dev.env.txt # jsonschema -jupyter-core==5.7.1 +jupyter-core==5.7.2 # via # -c max_compat/dev.env.txt # nbformat -kiwisolver==1.4.5 +kiwisolver==1.4.7 # via # -c max_compat/dev.env.txt # matplotlib -matplotlib==3.7.4 +matplotlib==3.7.5 # via # -c max_compat/dev.env.txt # cirq-core @@ -100,7 +100,7 @@ mpmath==1.3.0 # via # -c max_compat/dev.env.txt # sympy -nbformat==5.9.2 +nbformat==5.10.4 # via # -c max_compat/dev.env.txt # -r deps/pytest.txt @@ -119,7 +119,7 @@ numpy==1.24.4 # matplotlib # pandas # scipy -packaging==23.2 +packaging==24.2 # via # -c max_compat/dev.env.txt # deprecation @@ -129,7 +129,7 @@ pandas==2.0.3 # via # -c max_compat/dev.env.txt # cirq-core -pillow==10.3.0 +pillow==10.4.0 # via # -c max_compat/dev.env.txt # matplotlib @@ -137,11 +137,11 @@ pkgutil-resolve-name==1.3.10 # via # -c max_compat/dev.env.txt # jsonschema -platformdirs==4.1.0 +platformdirs==4.3.6 # via # -c max_compat/dev.env.txt # jupyter-core -pluggy==1.3.0 +pluggy==1.5.0 # via # -c max_compat/dev.env.txt # pytest @@ -149,48 +149,48 @@ pubchempy==1.0.4 # via # -c max_compat/dev.env.txt # -r deps/runtime.txt -pyparsing==3.1.1 +pyparsing==3.1.4 # via # -c max_compat/dev.env.txt # matplotlib -pytest==7.4.4 +pytest==8.3.4 # via # -c max_compat/dev.env.txt # -r deps/pytest.txt # pytest-asyncio # pytest-cov # pytest-xdist -pytest-asyncio==0.23.3 +pytest-asyncio==0.24.0 # via # -c max_compat/dev.env.txt # -r deps/pytest.txt -pytest-cov==4.1.0 +pytest-cov==5.0.0 # via # -c max_compat/dev.env.txt # -r deps/pytest.txt -pytest-xdist==3.5.0 +pytest-xdist==3.6.1 # via # -c max_compat/dev.env.txt # -r deps/pytest.txt -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via # -c max_compat/dev.env.txt # matplotlib # pandas -pytz==2023.3.post1 +pytz==2025.1 # via # -c max_compat/dev.env.txt # pandas -referencing==0.32.1 +referencing==0.35.1 # via # -c max_compat/dev.env.txt # jsonschema # jsonschema-specifications -requests==2.32.2 +requests==2.32.3 # via # -c max_compat/dev.env.txt # -r deps/runtime.txt -rpds-py==0.17.1 +rpds-py==0.20.1 # via # -c max_compat/dev.env.txt # jsonschema @@ -200,7 +200,7 @@ scipy==1.10.1 # -c max_compat/dev.env.txt # -r deps/runtime.txt # cirq-core -six==1.16.0 +six==1.17.0 # via # -c max_compat/dev.env.txt # python-dateutil @@ -208,38 +208,38 @@ sortedcontainers==2.4.0 # via # -c max_compat/dev.env.txt # cirq-core -sympy==1.12 +sympy==1.13.3 # via # -c max_compat/dev.env.txt # -r deps/runtime.txt # cirq-core -tomli==2.0.1 +tomli==2.2.1 # via # -c max_compat/dev.env.txt # coverage # pytest -tqdm==4.66.3 +tqdm==4.67.1 # via # -c max_compat/dev.env.txt # cirq-core -traitlets==5.14.1 +traitlets==5.14.3 # via # -c max_compat/dev.env.txt # jupyter-core # nbformat -typing-extensions==4.9.0 +typing-extensions==4.12.2 # via # -c max_compat/dev.env.txt # cirq-core -tzdata==2023.4 +tzdata==2025.1 # via # -c max_compat/dev.env.txt # pandas -urllib3==2.2.2 +urllib3==2.2.3 # via # -c max_compat/dev.env.txt # requests -zipp==3.19.1 +zipp==3.20.2 # via # -c max_compat/dev.env.txt # importlib-resources diff --git a/dev_tools/requirements/re-pip-compile-in-docker.sh b/dev_tools/requirements/re-pip-compile-in-docker.sh old mode 100644 new mode 100755 diff --git a/pyproject.toml b/pyproject.toml index c9f589cb2..c9177da7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.black] line-length = 100 -target_version = ['py39', 'py310'] +target_version = ['py310', 'py311', 'py312', 'py313'] skip-string-normalization = true skip-magic-trailing-comma = true From 52278cf2245f8f0ce42288b40dc2bc122d0a838b Mon Sep 17 00:00:00 2001 From: Michael Hucka Date: Mon, 3 Feb 2025 20:42:09 -0800 Subject: [PATCH 2/4] Correct Nick Rubin's affiliation (#937) --- .zenodo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zenodo.json b/.zenodo.json index 1a72c92fb..b13cf0519 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -16,7 +16,7 @@ }, { "name": "Nicholas Rubin", - "affiliation": "Rigetti Computing, Berkeley, California, US" + "affiliation": "Google LLC" }, { "name": "Kevin J. Sung", From 6066fee5c1000b3871fa8580eae3fcfb8d9201ba Mon Sep 17 00:00:00 2001 From: Michael Hucka Date: Mon, 3 Feb 2025 22:30:48 -0800 Subject: [PATCH 3/4] Replace no-longer-available SciPy constructs (#935) In SciPy 1.14, they removed the `.A` sparse matrix attribute; users are now supposed to call `.toarray()` instead. --- .../linalg/linear_qubit_operator_test.py | 2 +- src/openfermion/linalg/sparse_tools_test.py | 76 +++++++++---------- 2 files changed, 37 insertions(+), 41 deletions(-) diff --git a/src/openfermion/linalg/linear_qubit_operator_test.py b/src/openfermion/linalg/linear_qubit_operator_test.py index 8fb35f95a..ee3e872c6 100644 --- a/src/openfermion/linalg/linear_qubit_operator_test.py +++ b/src/openfermion/linalg/linear_qubit_operator_test.py @@ -182,7 +182,7 @@ def test_matvec_compare(self): [LinearQubitOperator(qubit_operator) * v for v in numpy.identity(16)] ) ), - mat_expected.A, + mat_expected.toarray(), ) ) diff --git a/src/openfermion/linalg/sparse_tools_test.py b/src/openfermion/linalg/sparse_tools_test.py index 99ad58c69..29be37fea 100644 --- a/src/openfermion/linalg/sparse_tools_test.py +++ b/src/openfermion/linalg/sparse_tools_test.py @@ -140,16 +140,24 @@ def test_qubit_jw_fermion_integration(self): class JordanWignerSparseTest(unittest.TestCase): def test_jw_sparse_0create(self): expected = csc_matrix(([1], ([1], [0])), shape=(2, 2)) - self.assertTrue(numpy.allclose(jordan_wigner_sparse(FermionOperator('0^')).A, expected.A)) + self.assertTrue( + numpy.allclose( + jordan_wigner_sparse(FermionOperator('0^')).toarray(), expected.toarray() + ) + ) def test_jw_sparse_1annihilate(self): expected = csc_matrix(([1, -1], ([0, 2], [1, 3])), shape=(4, 4)) - self.assertTrue(numpy.allclose(jordan_wigner_sparse(FermionOperator('1')).A, expected.A)) + self.assertTrue( + numpy.allclose(jordan_wigner_sparse(FermionOperator('1')).toarray(), expected.toarray()) + ) def test_jw_sparse_0create_2annihilate(self): expected = csc_matrix(([-1j, 1j], ([4, 6], [1, 3])), shape=(8, 8), dtype=numpy.complex128) self.assertTrue( - numpy.allclose(jordan_wigner_sparse(FermionOperator('0^ 2', -1j)).A, expected.A) + numpy.allclose( + jordan_wigner_sparse(FermionOperator('0^ 2', -1j)).toarray(), expected.toarray() + ) ) def test_jw_sparse_0create_3annihilate(self): @@ -159,13 +167,17 @@ def test_jw_sparse_0create_3annihilate(self): dtype=numpy.complex128, ) self.assertTrue( - numpy.allclose(jordan_wigner_sparse(FermionOperator('0^ 3', -1j)).A, expected.A) + numpy.allclose( + jordan_wigner_sparse(FermionOperator('0^ 3', -1j)).toarray(), expected.toarray() + ) ) def test_jw_sparse_twobody(self): expected = csc_matrix(([1, 1], ([6, 14], [5, 13])), shape=(16, 16)) self.assertTrue( - numpy.allclose(jordan_wigner_sparse(FermionOperator('2^ 1^ 1 3')).A, expected.A) + numpy.allclose( + jordan_wigner_sparse(FermionOperator('2^ 1^ 1 3')).toarray(), expected.toarray() + ) ) def test_qubit_operator_sparse_n_qubits_too_small(self): @@ -174,7 +186,9 @@ def test_qubit_operator_sparse_n_qubits_too_small(self): def test_qubit_operator_sparse_n_qubits_not_specified(self): expected = csc_matrix(([1, 1, 1, 1], ([1, 0, 3, 2], [0, 1, 2, 3])), shape=(4, 4)) - self.assertTrue(numpy.allclose(qubit_operator_sparse(QubitOperator('X1')).A, expected.A)) + self.assertTrue( + numpy.allclose(qubit_operator_sparse(QubitOperator('X1')).toarray(), expected.toarray()) + ) def test_get_linear_qubit_operator_diagonal_wrong_n(self): """Testing with wrong n_qubits.""" @@ -364,8 +378,8 @@ def test_jw_restrict_operator(self): restricted_hamiltonian = jw_number_restrict_operator( hamiltonian_sparse, target_electrons, n_qubits ) - true_eigvals, _ = eigh(hamiltonian_sparse.A) - test_eigvals, _ = eigh(restricted_hamiltonian.A) + true_eigvals, _ = eigh(hamiltonian_sparse.toarray()) + test_eigvals, _ = eigh(restricted_hamiltonian.toarray()) self.assertAlmostEqual(norm(true_eigvals[:6] - test_eigvals[:6]), 0.0) @@ -375,7 +389,7 @@ def test_jw_restrict_operator_hopping_to_1_particle(self): hop_restrict = jw_number_restrict_operator(hop_sparse, 1, n_qubits=4) expected = csc_matrix(([1, 1], ([0, 2], [2, 0])), shape=(4, 4)) - self.assertTrue(numpy.allclose(hop_restrict.A, expected.A)) + self.assertTrue(numpy.allclose(hop_restrict.toarray(), expected.toarray())) def test_jw_restrict_operator_interaction_to_1_particle(self): interaction = FermionOperator('3^ 2^ 4 1') @@ -383,7 +397,7 @@ def test_jw_restrict_operator_interaction_to_1_particle(self): interaction_restrict = jw_number_restrict_operator(interaction_sparse, 1, n_qubits=6) expected = csc_matrix(([], ([], [])), shape=(6, 6)) - self.assertTrue(numpy.allclose(interaction_restrict.A, expected.A)) + self.assertTrue(numpy.allclose(interaction_restrict.toarray(), expected.toarray())) def test_jw_restrict_operator_interaction_to_2_particles(self): interaction = FermionOperator('3^ 2^ 4 1') + FermionOperator('4^ 1^ 3 2') @@ -396,7 +410,7 @@ def test_jw_restrict_operator_interaction_to_2_particles(self): # in the 2-particle subspace (1, 4) and (2, 3) are 7th and 9th. expected = csc_matrix(([-1, -1], ([7, 9], [9, 7])), shape=(dim, dim)) - self.assertTrue(numpy.allclose(interaction_restrict.A, expected.A)) + self.assertTrue(numpy.allclose(interaction_restrict.toarray(), expected.toarray())) def test_jw_restrict_operator_hopping_to_1_particle_default_nqubits(self): interaction = FermionOperator('3^ 2^ 4 1') + FermionOperator('4^ 1^ 3 2') @@ -410,7 +424,7 @@ def test_jw_restrict_operator_hopping_to_1_particle_default_nqubits(self): # in the 2-particle subspace (1, 4) and (2, 3) are 7th and 9th. expected = csc_matrix(([-1, -1], ([7, 9], [9, 7])), shape=(dim, dim)) - self.assertTrue(numpy.allclose(interaction_restrict.A, expected.A)) + self.assertTrue(numpy.allclose(interaction_restrict.toarray(), expected.toarray())) def test_jw_restrict_jellium_ground_state_integration(self): n_qubits = 4 @@ -582,7 +596,7 @@ def test_get_ground_state_hermitian(self): ) expected_state = csc_matrix( ([1j, 1], ([1, 2], [0, 0])), shape=(4, 1), dtype=numpy.complex128 - ).A + ).toarray() expected_state /= numpy.sqrt(2.0) self.assertAlmostEqual(ground[0], -2) @@ -753,9 +767,7 @@ def setUp(self): -1 + int(numpy.log2(self.hf_state1.shape[0])) - self.reversed_occupied_orbitals1[i] ) - self.reversed_hf_state_index1 = sum( - 2**index for index in self.reversed_occupied_orbitals1 - ) + self.reversed_hf_state_index1 = sum(2**index for index in self.reversed_occupied_orbitals1) def test_1body_hopping_operator_1D(self): operator = FermionOperator('2^ 0') @@ -884,9 +896,7 @@ def test_1d5_with_spin_10particles(self): ) self.hf_state_index3 = numpy.sum(2**occupied_states) - self.hf_state3 = csc_matrix( - ([1.0], ([self.hf_state_index3], [0])), shape=(2**n_qubits, 1) - ) + self.hf_state3 = csc_matrix(([1.0], ([self.hf_state_index3], [0])), shape=(2**n_qubits, 1)) self.orbital_occupations3 = [digit == '1' for digit in bin(self.hf_state_index3)[2:]][::-1] self.occupied_orbitals3 = [ @@ -899,9 +909,7 @@ def test_1d5_with_spin_10particles(self): -1 + int(numpy.log2(self.hf_state3.shape[0])) - self.reversed_occupied_orbitals3[i] ) - self.reversed_hf_state_index3 = sum( - 2**index for index in self.reversed_occupied_orbitals3 - ) + self.reversed_hf_state_index3 = sum(2**index for index in self.reversed_occupied_orbitals3) operator = ( FermionOperator('6^ 0^ 1^ 3 5 4', 2) @@ -946,9 +954,7 @@ def test_1d5_with_spin_7particles(self): ) self.hf_state_index3 = numpy.sum(2**occupied_states) - self.hf_state3 = csc_matrix( - ([1.0], ([self.hf_state_index3], [0])), shape=(2**n_qubits, 1) - ) + self.hf_state3 = csc_matrix(([1.0], ([self.hf_state_index3], [0])), shape=(2**n_qubits, 1)) self.orbital_occupations3 = [digit == '1' for digit in bin(self.hf_state_index3)[2:]][::-1] self.occupied_orbitals3 = [ @@ -961,9 +967,7 @@ def test_1d5_with_spin_7particles(self): -1 + int(numpy.log2(self.hf_state3.shape[0])) - self.reversed_occupied_orbitals3[i] ) - self.reversed_hf_state_index3 = sum( - 2**index for index in self.reversed_occupied_orbitals3 - ) + self.reversed_hf_state_index3 = sum(2**index for index in self.reversed_occupied_orbitals3) operator = ( FermionOperator('6^ 0^ 1^ 3 5 4', 2) @@ -1006,9 +1010,7 @@ def test_3d2_spinless(self): ) self.hf_state_index3 = numpy.sum(2**occupied_states) - self.hf_state3 = csc_matrix( - ([1.0], ([self.hf_state_index3], [0])), shape=(2**n_qubits, 1) - ) + self.hf_state3 = csc_matrix(([1.0], ([self.hf_state_index3], [0])), shape=(2**n_qubits, 1)) self.orbital_occupations3 = [digit == '1' for digit in bin(self.hf_state_index3)[2:]][::-1] self.occupied_orbitals3 = [ @@ -1021,9 +1023,7 @@ def test_3d2_spinless(self): -1 + int(numpy.log2(self.hf_state3.shape[0])) - self.reversed_occupied_orbitals3[i] ) - self.reversed_hf_state_index3 = sum( - 2**index for index in self.reversed_occupied_orbitals3 - ) + self.reversed_hf_state_index3 = sum(2**index for index in self.reversed_occupied_orbitals3) operator = ( FermionOperator('4^ 2^ 3^ 5 5 4', 2) @@ -1066,9 +1066,7 @@ def test_3d2_with_spin(self): ) self.hf_state_index3 = numpy.sum(2**occupied_states) - self.hf_state3 = csc_matrix( - ([1.0], ([self.hf_state_index3], [0])), shape=(2**n_qubits, 1) - ) + self.hf_state3 = csc_matrix(([1.0], ([self.hf_state_index3], [0])), shape=(2**n_qubits, 1)) self.orbital_occupations3 = [digit == '1' for digit in bin(self.hf_state_index3)[2:]][::-1] self.occupied_orbitals3 = [ @@ -1081,9 +1079,7 @@ def test_3d2_with_spin(self): -1 + int(numpy.log2(self.hf_state3.shape[0])) - self.reversed_occupied_orbitals3[i] ) - self.reversed_hf_state_index3 = sum( - 2**index for index in self.reversed_occupied_orbitals3 - ) + self.reversed_hf_state_index3 = sum(2**index for index in self.reversed_occupied_orbitals3) operator = ( FermionOperator('4^ 2^ 3^ 5 5 4', 2) From 35e01d98abff5727de59484cb154a3a7e378c4c1 Mon Sep 17 00:00:00 2001 From: Michael Hucka Date: Tue, 4 Feb 2025 07:38:49 -0800 Subject: [PATCH 4/4] Minor enhancements to README file & fix to setup.py (#934) * Minor enhancements to README file This fixes a couple of typos, adds a couple of badges, and tries to adjust some spacing issues. (The result looks better on PyPI than on GitHub because of GitHub's poor support for reStructuredText.) * Fix truncation of readme file contents The original code ended up cutting off the first line of the readme.rst file. Replaced it with something that doesn't do that and is a bit simpler. --- README.rst | 94 +++++++++++++++++++++++++++++++++--------------------- setup.py | 9 +++--- 2 files changed, 61 insertions(+), 42 deletions(-) diff --git a/README.rst b/README.rst index 6e55d45cc..8337ee709 100644 --- a/README.rst +++ b/README.rst @@ -1,40 +1,61 @@ -.. image:: docs/images/logo_horizontal.svg +.. image:: https://raw.githubusercontent.com/quantumlib/OpenFermion/refs/heads/master/docs/images/logo_horizontal.svg + :alt: OpenFermion logo + :width: 75% + :align: center -OpenFermion is an open source library for compiling and analyzing quantum -algorithms to simulate fermionic systems, including quantum chemistry. Among -other functionalities, this version features data structures and tools -for obtaining and manipulating representations of fermionic and qubit -Hamiltonians. For more information, see our -`release paper `__. +.. |ci| image:: https://img.shields.io/github/actions/workflow/status/quantumlib/openfermion/ci.yml?style=flat-square&logo=GitHub&label=Continous%20integration + :alt: Continuous integration status badge + :target: https://github.com/quantumlib/OpenFermion/workflows/Continuous%20Integration/badge.svg + +.. |python| image:: https://img.shields.io/badge/Python-3.10+-fcbc2c.svg?style=flat-square&logo=python&logoColor=white + :alt: Compatible with Python versions 3.10 and higher + :target: https://www.python.org/downloads/ +.. |license| image:: https://img.shields.io/badge/License-Apache%202.0-3c60b1.svg?logo=opensourceinitiative&logoColor=white&style=flat-square + :alt: Licensed under the Apache 2.0 license + :target: https://github.com/quantumlib/OpenFermion/blob/main/LICENSE +.. |version| image:: https://img.shields.io/pypi/v/OpenFermion.svg?logo=semantic-release&logoColor=white&label=Release&style=flat-square&color=fcbc2c + :alt: OpenFermion project on PyPI + :target: https://pypi.org/project/OpenFermion -.. image:: https://github.com/quantumlib/OpenFermion/workflows/Continuous%20Integration/badge.svg - :target: https://github.com/quantumlib/OpenFermion/workflows/Continuous%20Integration/badge.svg +.. |downloads| image:: https://img.shields.io/pypi/dm/openfermion?logo=PyPI&logoColor=white&style=flat-square&label=Downloads + :alt: OpenFermion downloads per month from PyPI + :target: https://img.shields.io/pypi/dm/OpenFermion -.. image:: https://readthedocs.org/projects/openfermion/badge/?version=latest - :target: http://openfermion.readthedocs.io/en/latest/?badge=latest - :alt: Documentation Status +.. class:: margin-top +.. class:: centered -.. image:: https://badge.fury.io/py/openfermion.svg - :target: https://badge.fury.io/py/openfermion +| +| |ci| |python| |license| |version| |downloads| -.. image:: https://img.shields.io/pypi/dm/openfermion - :target: https://img.shields.io/pypi/dm/openfermion +.. |vertspace| image:: https://upload.wikimedia.org/wikipedia/commons/archive/c/ca/20200404084254%211x1.png + :alt: Blank space + :width: 1px + :height: 30px +|vertspace| OpenFermion is an open source library for compiling and analyzing quantum +algorithms to simulate fermionic systems, including quantum chemistry. Among +other functionalities, it features data structures and tools for obtaining and +manipulating representations of fermionic and qubit Hamiltonians. For more +information, see our `release paper `__. -Run the interactive Jupyter Notebooks in Colab_ or MyBinder_: +You can run the interactive Jupyter Notebooks in |Colab|_ or |MyBinder|_. +.. |Colab| replace:: Colab .. _Colab: https://colab.research.google.com/github/quantumlib/OpenFermion -.. _MyBinder: https://mybinder.org/v2/gh/quantumlib/OpenFermion/master?filepath=examples +.. |MyBinder| replace:: MyBinder +.. _MyBinder: https://mybinder.org/v2/gh/quantumlib/OpenFermion/master?filepath=examples Installation and Documentation ============================== -Installing the latest **stable** OpenFermion requires pip. Make sure that you are using an up-to-date version of it. +Installing the latest **stable** OpenFermion requires the Python package +installer `pip `__. Make sure that you are using an +up-to-date version of it. -Documentation can be found at `quantumai.google/openfermion `__ and the following links +Documentation can be found at `quantumai.google/openfermion `__ and the following links: * `Installation `__ @@ -51,17 +72,13 @@ and usage instructions in the The Docker image provides a virtual environment with OpenFermion and select plugins pre-installed. The Docker installation should run on any operating system. -You might also want to explore the alpha release of the -`OpenFermion Cloud Library `__ -where users can share and download precomputed molecular benchmark files. - - Developer install ----------------- -To install the latest version of OpenFermion (in development mode): +To install the latest version of OpenFermion (in development mode), run +the following commands: -.. code-block:: bash +.. code-block:: shell git clone https://github.com/quantumlib/OpenFermion cd OpenFermion @@ -70,9 +87,10 @@ To install the latest version of OpenFermion (in development mode): Library install --------------- -To install the latest PyPI release as a library (in user mode): +To install the latest PyPI release as a library (in user mode), run +the following commands: -.. code-block:: bash +.. code-block:: shell python -m pip install --user openfermion @@ -84,21 +102,24 @@ Specifically, plugins are used to simulate and compile quantum circuits and to p classical electronic structure calculations. Follow the links below to learn more! -High performance simulators ------------------------------------------- +High-performance simulators +--------------------------- + * `OpenFermion-FQE `__ is - a high performance emulator of fermionic quantum evolutions specified + a high-performance emulator of fermionic quantum evolutions specified by a sequence of fermion operators, which can exploit fermionic symmetries such as spin and particle number. Circuit compilation plugins ------------------------------------------- +--------------------------- + * `Forest-OpenFermion `__ to support integration with `Forest `__. * `SFOpenBoson `__ to support integration with `Strawberry Fields `__. Electronic structure package plugins ------------------------------------ + * `OpenFermion-Psi4 `__ to support integration with `Psi4 `__. * `OpenFermion-PySCF `__ to support integration with `PySCF `__. @@ -112,8 +133,9 @@ How to contribute We'd love to accept your contributions and patches to OpenFermion. There are a few small guidelines you need to follow. -Contributions to OpenFermion must be accompanied by a Contributor License Agreement. -You (or your employer) retain the copyright to your contribution, +Contributions to OpenFermion must be accompanied by a Contributor License +Agreement (CLA). +You (or your employer) retain the copyright to your contribution; the CLA this simply gives us permission to use and redistribute your contributions as part of the project. Head over to https://cla.developers.google.com/ to see your current agreements on file or to sign a new one. @@ -181,8 +203,6 @@ Authors `Fang Zhang `__ (University of Michigan) and `Emiel Koridon `__ (Leiden University). - - How to cite =========== When using OpenFermion for research projects, please cite: diff --git a/setup.py b/setup.py index f4015f4b6..362ef441b 100755 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import io + import os from setuptools import find_packages, setup @@ -19,10 +19,9 @@ exec(open('src/openfermion/_version.py').read()) # Readme file as long_description: -long_description = '===========\n' + 'OpenFermion\n' + '===========\n' -stream = io.open('README.rst', encoding='utf-8') -stream.readline() -long_description += stream.read() +long_description = '===========\n' + 'OpenFermion\n' + '===========\n\n' +with open('README.rst', 'r', encoding='utf-8') as readme: + long_description += readme.read() # Read in package requirements.txt requirements = open('dev_tools/requirements/deps/runtime.txt').readlines()