Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced setup.py with pyproject.toml using hatchling backend #3152

Merged
merged 3 commits into from Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/openmdao_test_workflow.yml
Expand Up @@ -36,6 +36,7 @@ jobs:
OPTIONAL: '[all]'
JAX: '0.4.14'
BANDIT: true
PEP517: true
TESTS: true
# set DEBUG to create an interactive debugging session just before testflo is run.
# Note that the workflow will run until you cancel the debugging session.
Expand Down Expand Up @@ -151,7 +152,16 @@ jobs:
echo "============================================================="
echo "Install OpenMDAO"
echo "============================================================="
python -m pip install .${{ matrix.OPTIONAL }}
if [[ "${{ matrix.PEP517 }}" == "true" ]]; then
pip wheel --no-deps --use-pep517 .
WHEEL=`find openmdao-*.whl`
echo "-----------------------------------------------------------"
echo "Installing from wheel: $WHEEL"
echo "-----------------------------------------------------------"
python -m pip install $WHEEL${{ matrix.OPTIONAL }}
else
python -m pip install .${{ matrix.OPTIONAL }}
fi

- name: Install PETSc
if: matrix.PETSc
Expand Down
173 changes: 173 additions & 0 deletions pyproject.toml
@@ -0,0 +1,173 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "openmdao"
dynamic = ["version"]
description = "OpenMDAO framework infrastructure"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.8"
authors = [
{ name = "OpenMDAO Team", email = "openmdao@openmdao.org" },
]
keywords = [
"analysis",
"multi-disciplinary",
"multidisciplinary",
"optimization",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering",
]
dependencies = [
"networkx>=2.0",
"numpy",
"packaging",
"requests",
"scipy",
]

[project.optional-dependencies]
all = [
"openmdao[docs,doe,jax,notebooks,visualization,test]",
]
docs = [
"ipyparallel",
"jupyter-book",
"matplotlib",
"numpydoc>=1.1",
"sphinx-sitemap",
]
doe = [
"pyDOE3",
]
jax = [
"jax>=0.4.0",
"jaxlib>=0.4.0",
]
notebooks = [
"ipympl",
"notebook",
]
test = [
"aiounittest",
"num2words",
"numpydoc>=1.1",
"parameterized",
"playwright>=1.20",
"pycodestyle>=2.4.0",
"pydocstyle==2.0.0",
"testflo>=1.3.6",
"websockets>8",
]
visualization = [
"bokeh>=2.4.0",
"colorama",
"matplotlib",
]

[project.scripts]
openmdao = "openmdao.utils.om:openmdao_cmd"
reset_notebook = "openmdao.devtools.docutils:reset_notebook_cmd"
run_om_test = "openmdao.devtools.run_test:run_test"
webview = "openmdao.utils.webview:webview_argv"
wingproj = "openmdao.devtools.wingproj:run_wing"

[project.entry-points.openmdao_case_reader]
sqlitereader = "openmdao.recorders.sqlite_reader:SqliteCaseReader"

[project.entry-points.openmdao_case_recorder]
sqliterecorder = "openmdao.recorders.sqlite_recorder:SqliteRecorder"

[project.entry-points.openmdao_component]
addsubtractcomp = "openmdao.components.add_subtract_comp:AddSubtractComp"
balancecomp = "openmdao.components.balance_comp:BalanceComp"
crossproductcomp = "openmdao.components.cross_product_comp:CrossProductComp"
dotproductcomp = "openmdao.components.dot_product_comp:DotProductComp"
eqconstraintcomp = "openmdao.components.eq_constraint_comp:EQConstraintComp"
execcomp = "openmdao.components.exec_comp:ExecComp"
explicitfunccomp = "openmdao.components.explicit_func_comp:ExplicitFuncComp"
externalcodecomp = "openmdao.components.external_code_comp:ExternalCodeComp"
externalcodeimplicitcomp = "openmdao.components.external_code_comp:ExternalCodeImplicitComp"
implicitfunccomp = "openmdao.components.implicit_func_comp:ImplicitFuncComp"
indepvarcomp = "openmdao.core.indepvarcomp:IndepVarComp"
kscomp = "openmdao.components.ks_comp:KSComp"
linearsystemcomp = "openmdao.components.linear_system_comp:LinearSystemComp"
matrixvectorproductcomp = "openmdao.components.matrix_vector_product_comp:MatrixVectorProductComp"
metamodelsemistructuredcomp = "openmdao.components.meta_model_semi_structured_comp:MetaModelSemiStructuredComp"
metamodelstructuredcomp = "openmdao.components.meta_model_structured_comp:MetaModelStructuredComp"
metamodelunstructuredcomp = "openmdao.components.meta_model_unstructured_comp:MetaModelUnStructuredComp"
multifimetamodelunstructuredcomp = "openmdao.components.multifi_meta_model_unstructured_comp:MultiFiMetaModelUnStructuredComp"
muxcomp = "openmdao.components.mux_comp:MuxComp"
splinecomp = "openmdao.components.spline_comp:SplineComp"
submodelcomp = "openmdao.components.submodel_comp:SubmodelComp"
vectormagnitudecomp = "openmdao.components.vector_magnitude_comp:VectorMagnitudeComp"

[project.entry-points.openmdao_driver]
differentialevolutiondriver = "openmdao.drivers.differential_evolution_driver:DifferentialEvolutionDriver"
doedriver = "openmdao.drivers.doe_driver:DOEDriver"
driver = "openmdao.core.driver:Driver"
pyoptsparsedriver = "openmdao.drivers.pyoptsparse_driver:pyOptSparseDriver"
scipydriver = "openmdao.drivers.scipy_optimizer:ScipyOptimizeDriver"
simplegadriver = "openmdao.drivers.genetic_algorithm_driver:SimpleGADriver"

[project.entry-points.openmdao_group]
group = "openmdao.core.group:Group"
parallelgroup = "openmdao.core.parallel_group:ParallelGroup"

[project.entry-points.openmdao_lin_solver]
directsolver = "openmdao.solvers.linear.direct:DirectSolver"
linearblockgs = "openmdao.solvers.linear.linear_block_gs:LinearBlockGS"
linearblockjac = "openmdao.solvers.linear.linear_block_jac:LinearBlockJac"
linearrunoncec = "openmdao.solvers.linear.linear_runonce:LinearRunOnce"
petsckrylov = "openmdao.solvers.linear.petsc_ksp:PETScKrylov"
scipykrylov = "openmdao.solvers.linear.scipy_iter_solver:ScipyKrylov"
userdefined = "openmdao.solvers.linear.user_defined:LinearUserDefined"

[project.entry-points.openmdao_nl_solver]
armijogoldsteinls = "openmdao.solvers.linesearch.backtracking:ArmijoGoldsteinLS"
boundsenforcels = "openmdao.solvers.linesearch.backtracking:BoundsEnforceLS"
broydensolver = "openmdao.solvers.nonlinear.broyden:BroydenSolver"
newtonsolver = "openmdao.solvers.nonlinear.newton:NewtonSolver"
nonlinearblockgs = "openmdao.solvers.nonlinear.nonlinear_block_gs:NonlinearBlockGS"
nonlinearblockjac = "openmdao.solvers.nonlinear.nonlinear_block_jac:NonlinearBlockJac"
nonlinearrunonce = "openmdao.solvers.nonlinear.nonlinear_runonce:NonlinearRunOnce"

[project.entry-points.openmdao_report]
checks = "openmdao.error_checking.check_config:_check_report_register"
connections = "openmdao.visualization.connection_viewer.viewconns:_connections_report_register"
inputs = "openmdao.visualization.inputs_report.inputs_report:_inputs_report_register"
n2 = "openmdao.visualization.n2_viewer.n2_viewer:_n2_report_register"
optimizer = "openmdao.visualization.opt_report.opt_report:_optimizer_report_register"
scaling = "openmdao.visualization.scaling_viewer.scaling_report:_scaling_report_register"
summary = "openmdao.devtools.debug:_summary_report_register"
total_coloring = "openmdao.utils.coloring:_total_coloring_report_register"

[project.entry-points.openmdao_surrogate_model]
krigingsurrogate = "openmdao.surrogate_models.kriging:KrigingSurrogate"
multificokrigingsurrogate = "openmdao.surrogate_models.multifi_cokriging:MultiFiCoKrigingSurrogate"
nearestneighbor = "openmdao.surrogate_models.nearest_neighbor:NearestNeighbor"
responsesurface = "openmdao.surrogate_models.response_surface:ResponseSurface"

[project.urls]
Homepage = "http://openmdao.org"

[tool.hatch.version]
path = "openmdao/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
"/openmdao",
]