Repository: fractal-analytics-platform/fractal-client (language: python)

Issue:
Use consistent naming for repository, PyPI package, Python package module
Current status:
1. The repository name is `fractal`
2. The package on PyPI is `fractal-client`
3. The Python package is `fractal` (the one we import from)
4. The CLI command is `fractal`

I propose that:
1. We rename the repository (and its docs page) to `fractal-client`, to be in-line with the other Fractal repositories. This requires updating links here and there in the docs/splash pages. 
2. We keep the PyPI name as is.
3. We rename the Python package to `fractal_client`, so that we fit with the most common situation where the Python package name is a sanitized version of the PyPI package name (*). This requires a bunch of trivial replacements in the repository.
4. We keep the CLI command as is (i.e. `fractal`), both because it's simpler and because it's already part of some users' experience (e.g. through fractal-demos). But I'm also OK with renaming the command (e.g. to `fractal-client`?), if someone prefers to go that way.

These changes should not break any current use, because the only things that matter for a user are the `pip install fractal-client` and `fractal ...` commands.



(*) Our slightly non-standard naming scheme is perfectly valid, but it may require adding some more details e.g. when building a conda package from a pypi one - ref #533 (cc @aangelone2).
Fix bumpver issue
A recent use of bumpver (to create 1.3.6a0) was bugged, as it also replaced some dependencies' versions: https://github.com/fractal-analytics-platform/fractal-client/commit/1fb10f6785c849849fa95de8a4923fb3eac72aa6.

To review.


Discussion / hints:
Yes to 1-4 and let's not rename the CLI client


Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c69ab9b92..6a17cd6dc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
 
 # 1.3.6
 
+* Change package name from `fractal` to `fractal-client` (\#555).
 * Remove client-side validation of API request/response bodies (\#551).
 * Remove `fractal-common` submodule (\#551).
 * Make error messages more readable for request-body validation errors (\#551).
diff --git a/docs/development.md b/docs/development.md
index e3288376f..b9f6fa97c 100644
--- a/docs/development.md
+++ b/docs/development.md
@@ -1,10 +1,10 @@
 # Contribute to Fractal Client development
 
-The development of Fractal Client takes place on the [fractal Github
-repository](https://github.com/fractal-analytics-platform/fractal).  To
+The development of Fractal Client takes place on the [fractal-client Github
+repository](https://github.com/fractal-analytics-platform/fractal-client).  To
 ask questions or to inform us of a bug or unexpected behavior, please feel free
 to [open an
-issue](https://github.com/fractal-analytics-platform/fractal/issues/new).
+issue](https://github.com/fractal-analytics-platform/fractal-client/issues/new).
 
 
 ## Set up the development environment
@@ -13,7 +13,7 @@ issue](https://github.com/fractal-analytics-platform/fractal/issues/new).
 
 First, you should clone the repository
 ```
-git clone https://github.com/fractal-analytics-platform/fractal.git
+git clone https://github.com/fractal-analytics-platform/fractal-client.git
 cd fractal
 ```
 
@@ -73,15 +73,15 @@ the test suite by invoking
 ```
 poetry run pytest
 ```
-from the main directory of the `fractal` repository. It is sometimes
+from the main directory of the `fractal-client` repository. It is sometimes
 useful to specify additional arguments, e.g.
 ```
 poetry run pytest -s -vvv --log-cli-level info --full-trace
 ```
 
 Tests are also run as part of [GitHub Actions Continuous
-Integration](https://github.com/fractal-analytics-platform/fractal/actions/workflows/ci.yml)
-for the `fractal` repository.
+Integration](https://github.com/fractal-analytics-platform/fractal-client/actions/workflows/ci.yml)
+for the `fractal-client` repository.
 
 
 ## Documentation
diff --git a/docs/gen_ref_pages.py b/docs/gen_ref_pages.py
index c505d2b6d..845af204b 100644
--- a/docs/gen_ref_pages.py
+++ b/docs/gen_ref_pages.py
@@ -9,8 +9,9 @@
 
 sys.path.append(Path(__file__).parent.as_posix())  # noqa: E402
 from parser import parse_parser  # noqa: E402
+
 sys.path.append(Path(__file__).parents[1].as_posix())  # noqa: E402
-from fractal.parser import parser_main
+from fractal_client.parser import parser_main  # noqa
 
 
 def to_markdown(
diff --git a/fractal/__init__.py b/fractal_client/__init__.py
similarity index 100%
rename from fractal/__init__.py
rename to fractal_client/__init__.py
diff --git a/fractal/__main__.py b/fractal_client/__main__.py
similarity index 70%
rename from fractal/__main__.py
rename to fractal_client/__main__.py
index 2f150483f..0a3d1fc5b 100644
--- a/fractal/__main__.py
+++ b/fractal_client/__main__.py
@@ -1,6 +1,6 @@
 import asyncio
 
-from fractal.client import main
+from fractal_client.client import main
 
 
 def run():
diff --git a/fractal/authclient.py b/fractal_client/authclient.py
similarity index 100%
rename from fractal/authclient.py
rename to fractal_client/authclient.py
diff --git a/fractal/client.py b/fractal_client/client.py
similarity index 100%
rename from fractal/client.py
rename to fractal_client/client.py
diff --git a/fractal/cmd/__init__.py b/fractal_client/cmd/__init__.py
similarity index 100%
rename from fractal/cmd/__init__.py
rename to fractal_client/cmd/__init__.py
diff --git a/fractal/cmd/_aux_task_caching.py b/fractal_client/cmd/_aux_task_caching.py
similarity index 100%
rename from fractal/cmd/_aux_task_caching.py
rename to fractal_client/cmd/_aux_task_caching.py
diff --git a/fractal/cmd/_dataset.py b/fractal_client/cmd/_dataset.py
similarity index 100%
rename from fractal/cmd/_dataset.py
rename to fractal_client/cmd/_dataset.py
diff --git a/fractal/cmd/_job.py b/fractal_client/cmd/_job.py
similarity index 100%
rename from fractal/cmd/_job.py
rename to fractal_client/cmd/_job.py
diff --git a/fractal/cmd/_project.py b/fractal_client/cmd/_project.py
similarity index 100%
rename from fractal/cmd/_project.py
rename to fractal_client/cmd/_project.py
diff --git a/fractal/cmd/_task.py b/fractal_client/cmd/_task.py
similarity index 100%
rename from fractal/cmd/_task.py
rename to fractal_client/cmd/_task.py
diff --git a/fractal/cmd/_user.py b/fractal_client/cmd/_user.py
similarity index 100%
rename from fractal/cmd/_user.py
rename to fractal_client/cmd/_user.py
diff --git a/fractal/cmd/_workflow.py b/fractal_client/cmd/_workflow.py
similarity index 100%
rename from fractal/cmd/_workflow.py
rename to fractal_client/cmd/_workflow.py
diff --git a/fractal/config.py b/fractal_client/config.py
similarity index 100%
rename from fractal/config.py
rename to fractal_client/config.py
diff --git a/fractal/interface.py b/fractal_client/interface.py
similarity index 100%
rename from fractal/interface.py
rename to fractal_client/interface.py
diff --git a/fractal/parser.py b/fractal_client/parser.py
similarity index 100%
rename from fractal/parser.py
rename to fractal_client/parser.py
diff --git a/fractal/response.py b/fractal_client/response.py
similarity index 100%
rename from fractal/response.py
rename to fractal_client/response.py
diff --git a/mkdocs.yml b/mkdocs.yml
index 37400e818..fd5aecdb4 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -1,7 +1,7 @@
 site_name: Fractal Client
 
-repo_url: https://github.com/fractal-analytics-platform/fractal
-repo_name: fractal
+repo_url: https://github.com/fractal-analytics-platform/fractal-client
+repo_name: fractal-client
 
 markdown_extensions:
 - admonition
@@ -49,7 +49,7 @@ nav:
   - Changelog: changelog.md
 
 watch:
-  - fractal
+  - fractal_client
 
 plugins:
   - search
diff --git a/poetry.lock b/poetry.lock
index 72f42f0ce..59467fed0 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1,4 +1,4 @@
-# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand.
+# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand.
 
 [[package]]
 name = "aiosqlite"
@@ -973,16 +973,6 @@ files = [
     {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"},
     {file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"},
     {file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"},
-    {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:f698de3fd0c4e6972b92290a45bd9b1536bffe8c6759c62471efaa8acb4c37bc"},
-    {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aa57bd9cf8ae831a362185ee444e15a93ecb2e344c8e52e4d721ea3ab6ef1823"},
-    {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ffcc3f7c66b5f5b7931a5aa68fc9cecc51e685ef90282f4a82f0f5e9b704ad11"},
-    {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47d4f1c5f80fc62fdd7777d0d40a2e9dda0a05883ab11374334f6c4de38adffd"},
-    {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1f67c7038d560d92149c060157d623c542173016c4babc0c1913cca0564b9939"},
-    {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:9aad3c1755095ce347e26488214ef77e0485a3c34a50c5a5e2471dff60b9dd9c"},
-    {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:14ff806850827afd6b07a5f32bd917fb7f45b046ba40c57abdb636674a8b559c"},
-    {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8f9293864fe09b8149f0cc42ce56e3f0e54de883a9de90cd427f191c346eb2e1"},
-    {file = "MarkupSafe-2.1.3-cp312-cp312-win32.whl", hash = "sha256:715d3562f79d540f251b99ebd6d8baa547118974341db04f5ad06d5ea3eb8007"},
-    {file = "MarkupSafe-2.1.3-cp312-cp312-win_amd64.whl", hash = "sha256:1b8dd8c3fd14349433c79fa8abeb573a55fc0fdd769133baac1f5e07abf54aeb"},
     {file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"},
     {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"},
     {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"},
@@ -1831,7 +1821,7 @@ files = [
 ]
 
 [package.dependencies]
-greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")"}
+greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and (platform_machine == \"win32\" or platform_machine == \"WIN32\" or platform_machine == \"AMD64\" or platform_machine == \"amd64\" or platform_machine == \"x86_64\" or platform_machine == \"ppc64le\" or platform_machine == \"aarch64\")"}
 
 [package.extras]
 aiomysql = ["aiomysql", "greenlet (!=0.4.17)"]
diff --git a/pyproject.toml b/pyproject.toml
index ee1792579..15f6cdc5c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -9,12 +9,12 @@ authors = [
 ]
 readme = "README.md"
 packages = [
-    {include="fractal"}
+    {include="fractal_client"}
 ]
 homepage = "https://github.com/fractal-analytics-platform/fractal"
 license = "BSD-3-Clause"
 exclude = [
-"fractal/.gitignore",
+"fractal_client/.gitignore",
 ]
 
 
@@ -48,8 +48,8 @@ mkdocs-material = "9.1.21"
 mkdocs-literate-nav = "0.5.0"
 mkdocs-gen-files = "0.4.0"
 mkdocs-section-index = "0.3.5"
-mkdocstrings = { extras = ["python"], version = "1.3.6a0" }
-mkdocs-include-markdown-plugin = { version = "1.3.6a0", python = "^3.8,<3.12" }
+mkdocstrings = { extras = ["python"], version = "0.22.0" }
+mkdocs-include-markdown-plugin = { version = "4.0.4", python = "^3.8,<3.12" }
 
 [build-system]
 requires = ["poetry-core"]
@@ -70,14 +70,12 @@ push = true
 "pyproject.toml" = [
     'version = "{version}"',
 ]
-"fractal/__init__.py" = [
+"fractal_client/__init__.py" = [
     '__VERSION__ = "{version}"'
 ]
 
 [tool.poetry.scripts]
-fractal = "fractal.__main__:run"
-fractal_old = "fractal.old:run"
-fractal_new = "fractal.new:run"
+fractal = "fractal_client.__main__:run"
 
 [tool.coverage.run]
 branch = true


Test patch:
diff --git a/tests/conftest.py b/tests/conftest.py
index 9cbffcfe4..92ab4db1f 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -42,7 +42,7 @@ async def client():
 
 @pytest.fixture
 async def client_superuser():
-    from fractal.authclient import AuthClient
+    from fractal_client.authclient import AuthClient
 
     async with AuthClient(
         username="admin@fractal.xy",
@@ -61,7 +61,7 @@ def __clisplit(args: str):
 
 @pytest.fixture
 async def invoke(clisplit):
-    from fractal.client import handle
+    from fractal_client.client import handle
 
     async def __invoke(args: str):
         return await handle(clisplit(args))
@@ -71,7 +71,7 @@ async def __invoke(args: str):
 
 @pytest.fixture
 async def invoke_as_superuser(clisplit):
-    from fractal.client import handle
+    from fractal_client.client import handle
 
     async def __invoke(args: str):
         new_args = f"--user admin@fractal.xy --password 1234 {args}"
@@ -82,7 +82,7 @@ async def __invoke(args: str):
 
 @pytest.fixture
 def clear_task_cache():
-    from fractal.config import settings
+    from fractal_client.config import settings
 
     # This is a workaround to clean up the state before the test. The right way
     # would be to inject a new (function-scoped) FRACTAL_CACHE_PATH variable
diff --git a/tests/test_auth.py b/tests/test_auth.py
index 1e8bd0c6e..75d0361f8 100644
--- a/tests/test_auth.py
+++ b/tests/test_auth.py
@@ -2,8 +2,8 @@
 
 import pytest
 
-from fractal.authclient import AuthenticationError
-from fractal.authclient import AuthToken
+from fractal_client.authclient import AuthenticationError
+from fractal_client.authclient import AuthToken
 
 
 async def test_auth_fail(client):
diff --git a/tests/test_client.py b/tests/test_client.py
index f916dfaca..bcc72b714 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -5,8 +5,8 @@
 import pytest
 from devtools import debug
 
-from fractal import __VERSION__
-from fractal.client import MissingCredentialsError
+from fractal_client import __VERSION__
+from fractal_client.client import MissingCredentialsError
 
 
 DEFAULT_TEST_EMAIL = environ["FRACTAL_USER"]
@@ -68,17 +68,17 @@ async def test_missing_credentials(monkeypatch):
     """
 
     # Define patched settings
-    from fractal.config import Settings
+    from fractal_client.config import Settings
 
     patched_settings = Settings()
     patched_settings.FRACTAL_USER = None
 
     with monkeypatch.context() as m:
-        import fractal
-        from fractal.client import handle
+        import fractal_client
+        from fractal_client.client import handle
 
-        m.setattr(fractal.client, "settings", patched_settings)
-        debug(fractal.config.settings)
+        m.setattr(fractal_client.client, "settings", patched_settings)
+        debug(fractal_client.config.settings)
         with pytest.raises(MissingCredentialsError) as e:
             await handle(shlex.split("fractal user whoami"))
         debug(e.value)
diff --git a/tests/test_task.py b/tests/test_task.py
index e8b04efd5..8dd660edb 100644
--- a/tests/test_task.py
+++ b/tests/test_task.py
@@ -5,8 +5,8 @@
 import pytest
 from devtools import debug
 
-from fractal.cmd._aux_task_caching import TASKS_CACHE_FILENAME
-from fractal.config import settings
+from fractal_client.cmd._aux_task_caching import TASKS_CACHE_FILENAME
+from fractal_client.config import settings
 
 
 COLLECTION_TIMEOUT = 15.0
diff --git a/tests/test_unit_response.py b/tests/test_unit_response.py
index 31b1f0615..fdb058eb4 100644
--- a/tests/test_unit_response.py
+++ b/tests/test_unit_response.py
@@ -2,7 +2,7 @@
 from httpx import Request
 from httpx import Response
 
-from fractal.response import check_response
+from fractal_client.response import check_response
 
 
 def test_check_response(caplog):
diff --git a/tests/test_unit_task_cache.py b/tests/test_unit_task_cache.py
index 4617a52fc..5dda769d9 100644
--- a/tests/test_unit_task_cache.py
+++ b/tests/test_unit_task_cache.py
@@ -1,8 +1,8 @@
 import pytest
 
-from fractal.cmd._aux_task_caching import _get_matching_tasks
-from fractal.cmd._aux_task_caching import _search_in_task_list
-from fractal.cmd._aux_task_caching import FractalCacheError
+from fractal_client.cmd._aux_task_caching import _get_matching_tasks
+from fractal_client.cmd._aux_task_caching import _search_in_task_list
+from fractal_client.cmd._aux_task_caching import FractalCacheError
 
 
 def test_get_matching_tasks(clear_task_cache):
diff --git a/tests/test_unit_versions.py b/tests/test_unit_versions.py
index 9dc3eeecb..c9f8be5ab 100644
--- a/tests/test_unit_versions.py
+++ b/tests/test_unit_versions.py
@@ -2,7 +2,7 @@
 from devtools import debug
 from packaging import version
 
-from fractal.cmd._aux_task_caching import _loose_version_parse
+from fractal_client.cmd._aux_task_caching import _loose_version_parse
 
 
 # string, major, minor, micro, is_prerelease