Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ files configure various tools to the project conventions:

* `.pylintrc`: Python file lint

* `.pyproject.toml`: Python tools other than Pylint
* `pyproject.toml`: package metadata, dependencies, and Python tool configuration (except Pylint)

* `.yamllint.yaml`: YAML files

Expand Down Expand Up @@ -222,12 +222,22 @@ After that, the hooks will run automatically when triggered by the corresponding
pip install -U pip
```

2. Use the following command to install Python dependencies into the virtual environment:
2. Use one of the following to install Python dependencies into the virtual environment:

```shell
pip install -r dev_tools/requirements/envs/dev.env.txt
```

Or, with [uv](https://docs.astral.sh/uv/) (locked files are still generated from
`dev_tools/requirements/deps/*.txt`; see _Regenerating requirements files_ below):

```shell
uv sync --group dev
```

Package metadata and runtime dependencies are defined in `pyproject.toml` (there is no
`setup.py`).

Please refer to the section _Developer install_ of the [installation instructions](docs/install.md)
for information about how to set up a local copy of the software for development.

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include LICENSE
include MANIFEST.in
include NOTICE
include README.md
include pyproject.toml
include dev_tools/requirements/deps/runtime.txt
include dev_tools/requirements/deps/resource_estimates_runtime.txt
include setup.py
recursive-include src *.py *.hdf5 *.h5 bad_type_operator.data geometry_example.txt
3 changes: 2 additions & 1 deletion dev_tools/packaging/produce-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
# this, stricter requirements for versioning were introduced. This means that
# the "version" argument to this script must conform to patterns described at
# https://packaging.python.org/en/latest/discussions/versioning/.
# Project metadata and dependencies are defined in pyproject.toml.
################################################################################

PROJECT_NAME=openfermion
Expand Down Expand Up @@ -64,7 +65,7 @@ function confirm() {
}

# Make a clean copy of HEAD, without files ignored by git (but potentially kept
# by setup.py).
# locally).
if [ -n "$(git status --short)" ]; then
echo -e "${RED}WARNING: There are uncommitted git changes."
echo -e "They won't be included in the package.${RESET}"
Expand Down
150 changes: 149 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2025 Google LLC
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,6 +12,154 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Note: there are three types of dependencies listed in this file:
#
# [build-system].requires: packages needed by the build backend. Not stored in
# package metadata.
#
# [project].dependencies: core runtime packages (install_requires). Stored in
# package metadata and installed with `pip install openfermion`.
#
# [dependency-groups].dev: development tools for tests, linters, and packaging.
# Install with `uv sync --group dev` or `pip install --group dev` (PEP 735).
# Locked CI environments are still generated under dev_tools/requirements/envs/
# via dev_tools/requirements/create-env-files.sh.

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=78.1.1", "wheel"]

[project]
name = "openfermion"
description = "The electronic structure package for quantum computers."
readme = {file = "README.md", content-type = "text/markdown"}
license = "Apache-2.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Under PEP 621, the license field must be a table containing either a text or file key (e.g., license = {text = "Apache-2.0"}). Providing a plain string is invalid under the PEP 621 specification and can cause validation errors with strict packaging tools.

license = {text = "Apache-2.0"}

authors = [
{name = "The OpenFermion Developers", email = "openfermion-dev@googlegroups.com"},
]
maintainers = [
{name = "Google Quantum AI open-source maintainers", email = "quantum-oss-maintainers@google.com"},
]
requires-python = ">=3.10.0"
dynamic = ["version", "dependencies", "optional-dependencies"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Scientific/Engineering :: Quantum Computing",
]
Comment on lines +45 to +60

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The classifier "License :: OSI Approved :: Apache Software License" is missing from the classifiers list. To maintain functional equivalence with the original setup.py configuration and ensure proper categorization on PyPI, please include it.

classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Intended Audience :: Developers",
    "Intended Audience :: Education",
    "Intended Audience :: Science/Research",
    "License :: OSI Approved :: Apache Software License",
    "Operating System :: MacOS",
    "Operating System :: Microsoft :: Windows",
    "Operating System :: POSIX :: Linux",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Topic :: Scientific/Engineering :: Chemistry",
    "Topic :: Scientific/Engineering :: Quantum Computing",
]
References
  1. When migrating configuration, keep the settings functionally equivalent to the original to maintain a clean change history.

keywords = [
"algorithms",
"api",
"application programming interface",
"chemistry",
"cirq",
"electronic structure",
"fermion",
"fermionic systems",
"google quantum",
"google",
"hamiltonians",
"high performance",
"nisq",
"noisy intermediate-scale quantum",
"python",
"quantum algorithms",
"quantum chemistry",
"quantum circuit simulator",
"quantum circuit",
"quantum computer simulator",
"quantum computing",
"quantum development kit",
"quantum programming language",
"quantum programming",
"quantum simulation",
"quantum",
"qubit hamiltonians",
"qubit",
"sdk",
"simulation",
"software development kit",
]

[project.urls]
Homepage = "https://quantumai.google/openfermion"
Documentation = "https://quantumai.google/openfermion"
Source = "https://github.com/quantumlib/OpenFermion"

[dependency-groups]
# Development dependencies. Keep in sync with dev_tools/requirements/deps/*.txt.
dev = [
# Formatting and linting.
"black",
"mypy",
"pandas-stubs",
"pylint~=3.3",
"types-networkx",
"types-requests",
"types-setuptools",

# Testing.
"nbformat",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-randomly",
"pytest-retry",
"pytest-xdist",
"tensorflow-docs",

# Resource-estimate runtime deps (see resource_estimates_runtime.txt).
"ase",
"jax",
"jaxlib",
"pyscf",

# Packaging and requirements regeneration.
"build",
"setuptools",
"shellcheck-py~=0.11.0",
"twine",
"uv",
"virtualenv",
"wheel",
]

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-dir]
"" = "src"

[tool.setuptools.package-data]
openfermion = [
"resource_estimates/integrals/*.h5",
"testing/*.npy",
"testing/*.hdf5",
"testing/*.data",
"testing/*.txt",
]

[tool.setuptools.dynamic]
version = {attr = "openfermion._version.__version__"}
dependencies = {file = ["dev_tools/requirements/deps/runtime.txt"]}

[tool.setuptools.dynamic.optional-dependencies]
resources = {file = ["dev_tools/requirements/deps/resource_estimates_runtime.txt"]}

[tool.black]
line-length = 100
target-version = ['py310', 'py311', 'py312', 'py313']
Expand Down
113 changes: 0 additions & 113 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/openfermion/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Define version number here and read it from setup.py automatically"""
"""Define version number here; read by setuptools from pyproject.toml."""

__version__ = "1.7.2.dev0"
Loading