diff --git a/py-rattler/docs/environment_creation_error.md b/py-rattler/docs/environment_creation_error.md new file mode 100644 index 000000000..6af401028 --- /dev/null +++ b/py-rattler/docs/environment_creation_error.md @@ -0,0 +1,3 @@ +# EnvironmentCreationError + +::: rattler.exceptions.EnvironmentCreationError diff --git a/py-rattler/mkdocs.yml b/py-rattler/mkdocs.yml index b16edb662..1d59ef3e6 100644 --- a/py-rattler/mkdocs.yml +++ b/py-rattler/mkdocs.yml @@ -81,6 +81,7 @@ nav: - ActivationError: activation_error.md - CacheDirError: cache_dir_error.md - DetectVirtualPackageError: detect_virtual_package_error.md + - EnvironmentCreationError: environment_creation_error.md - FetchRepoDataError: fetch_repo_data_error.md - InvalidChannelError: invalid_channel_error.md - InvalidMatchSpecError: invalid_match_spec_error.md diff --git a/py-rattler/rattler/exceptions.py b/py-rattler/rattler/exceptions.py index 5ec6791e9..6929a8deb 100644 --- a/py-rattler/rattler/exceptions.py +++ b/py-rattler/rattler/exceptions.py @@ -17,6 +17,7 @@ SolverError, ConvertSubdirError, VersionBumpError, + EnvironmentCreationError, ) except ImportError: # They are only redefined for documentation purposes @@ -73,6 +74,9 @@ class ConvertSubdirError(Exception): # type: ignore[no-redef] class VersionBumpError(Exception): # type: ignore[no-redef] """An error that can occur when bumping a version.""" + class EnvironmentCreationError(Exception): # type: ignore[no-redef] + """An error that can occur when creating an environment.""" + __all__ = [ "ActivationError", @@ -92,4 +96,5 @@ class VersionBumpError(Exception): # type: ignore[no-redef] "TransactionError", "ConvertSubdirError", "VersionBumpError", + "EnvironmentCreationError", ] diff --git a/py-rattler/src/lib.rs b/py-rattler/src/lib.rs index a7ab18f2a..26b2916cb 100644 --- a/py-rattler/src/lib.rs +++ b/py-rattler/src/lib.rs @@ -21,10 +21,11 @@ mod virtual_package; use channel::{PyChannel, PyChannelConfig}; use error::{ ActivationException, CacheDirException, ConvertSubdirException, DetectVirtualPackageException, - FetchRepoDataException, InvalidChannelException, InvalidMatchSpecException, - InvalidPackageNameException, InvalidUrlException, InvalidVersionException, IoException, - LinkException, ParseArchException, ParsePlatformException, PyRattlerError, SolverException, - TransactionException, VersionBumpException, + EnvironmentCreationException, FetchRepoDataException, InvalidChannelException, + InvalidMatchSpecException, InvalidPackageNameException, InvalidUrlException, + InvalidVersionException, IoException, LinkException, ParseArchException, + ParsePlatformException, PyRattlerError, SolverException, TransactionException, + VersionBumpException, }; use generic_virtual_package::PyGenericVirtualPackage; use lock::{ @@ -158,5 +159,12 @@ fn rattler(py: Python<'_>, m: &PyModule) -> PyResult<()> { .unwrap(); m.add("VersionBumpError", py.get_type::()) .unwrap(); + + m.add( + "EnvironmentCreationError", + py.get_type::(), + ) + .unwrap(); + Ok(()) }