calkit-python 0.21.4__tar.gz → 0.21.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. {calkit_python-0.21.4 → calkit_python-0.21.5}/PKG-INFO +8 -6
  2. {calkit_python-0.21.4 → calkit_python-0.21.5}/README.md +7 -5
  3. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/__init__.py +1 -1
  4. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/cli/new.py +63 -7
  5. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/tests/cli/test_new.py +34 -0
  6. calkit_python-0.21.5/docs/installation.md +22 -0
  7. calkit_python-0.21.4/docs/installation.md +0 -18
  8. {calkit_python-0.21.4 → calkit_python-0.21.5}/.github/FUNDING.yml +0 -0
  9. {calkit_python-0.21.4 → calkit_python-0.21.5}/.github/workflows/docs.yml +0 -0
  10. {calkit_python-0.21.4 → calkit_python-0.21.5}/.github/workflows/format.yml +0 -0
  11. {calkit_python-0.21.4 → calkit_python-0.21.5}/.github/workflows/publish-test.yml +0 -0
  12. {calkit_python-0.21.4 → calkit_python-0.21.5}/.github/workflows/publish.yml +0 -0
  13. {calkit_python-0.21.4 → calkit_python-0.21.5}/.github/workflows/test.yml +0 -0
  14. {calkit_python-0.21.4 → calkit_python-0.21.5}/.gitignore +0 -0
  15. {calkit_python-0.21.4 → calkit_python-0.21.5}/.pre-commit-config.yaml +0 -0
  16. {calkit_python-0.21.4 → calkit_python-0.21.5}/CONTRIBUTING.md +0 -0
  17. {calkit_python-0.21.4 → calkit_python-0.21.5}/LICENSE +0 -0
  18. {calkit_python-0.21.4 → calkit_python-0.21.5}/Makefile +0 -0
  19. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/__main__.py +0 -0
  20. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/calc.py +0 -0
  21. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/check.py +0 -0
  22. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/cli/__init__.py +0 -0
  23. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/cli/check.py +0 -0
  24. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/cli/cloud.py +0 -0
  25. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/cli/config.py +0 -0
  26. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/cli/core.py +0 -0
  27. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/cli/import_.py +0 -0
  28. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/cli/list.py +0 -0
  29. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/cli/main.py +0 -0
  30. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/cli/notebooks.py +0 -0
  31. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/cli/office.py +0 -0
  32. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/cli/update.py +0 -0
  33. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/cloud.py +0 -0
  34. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/conda.py +0 -0
  35. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/config.py +0 -0
  36. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/core.py +0 -0
  37. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/datasets.py +0 -0
  38. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/docker.py +0 -0
  39. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/dvc.py +0 -0
  40. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/git.py +0 -0
  41. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/github.py +0 -0
  42. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/gui.py +0 -0
  43. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/jupyter.py +0 -0
  44. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/magics.py +0 -0
  45. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/models.py +0 -0
  46. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/office.py +0 -0
  47. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/ops.py +0 -0
  48. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/releases.py +0 -0
  49. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/server.py +0 -0
  50. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/templates/__init__.py +0 -0
  51. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/templates/core.py +0 -0
  52. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/templates/latex/__init__.py +0 -0
  53. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/templates/latex/article/paper.tex +0 -0
  54. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/templates/latex/core.py +0 -0
  55. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/templates/latex/jfm/jfm.bst +0 -0
  56. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/templates/latex/jfm/jfm.cls +0 -0
  57. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/templates/latex/jfm/lineno-FLM.sty +0 -0
  58. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/templates/latex/jfm/paper.tex +0 -0
  59. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/templates/latex/jfm/upmath.sty +0 -0
  60. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/tests/__init__.py +0 -0
  61. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/tests/cli/__init__.py +0 -0
  62. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/tests/cli/test_list.py +0 -0
  63. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/tests/cli/test_main.py +0 -0
  64. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/tests/test_calc.py +0 -0
  65. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/tests/test_check.py +0 -0
  66. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/tests/test_conda.py +0 -0
  67. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/tests/test_core.py +0 -0
  68. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/tests/test_dvc.py +0 -0
  69. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/tests/test_jupyter.py +0 -0
  70. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/tests/test_magics.py +0 -0
  71. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/tests/test_templates.py +0 -0
  72. {calkit_python-0.21.4 → calkit_python-0.21.5}/calkit/zenodo.py +0 -0
  73. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/CNAME +0 -0
  74. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/apps.md +0 -0
  75. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/calculations.md +0 -0
  76. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/calkit-yaml.md +0 -0
  77. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/cli-reference.md +0 -0
  78. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/cloud-integration.md +0 -0
  79. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/datasets.md +0 -0
  80. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/environments.md +0 -0
  81. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/examples.md +0 -0
  82. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/help.md +0 -0
  83. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/img/c-to-the-k-white.svg +0 -0
  84. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/img/calkit-no-bg.png +0 -0
  85. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/img/connect-zenodo.png +0 -0
  86. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/index.md +0 -0
  87. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/local-server.md +0 -0
  88. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/pipeline/index.md +0 -0
  89. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/pipeline/manual-steps.md +0 -0
  90. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/references.md +0 -0
  91. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/releases.md +0 -0
  92. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/adding-latex-pub-docker.md +0 -0
  93. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/conda-envs.md +0 -0
  94. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/existing-project.md +0 -0
  95. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/first-project.md +0 -0
  96. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/latex-codespaces/building-codespace.png +0 -0
  97. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/latex-codespaces/codespaces-secrets-2.png +0 -0
  98. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/latex-codespaces/editor-split.png +0 -0
  99. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/latex-codespaces/go-to-linked-code.png +0 -0
  100. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/latex-codespaces/issue-from-selection.png +0 -0
  101. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/latex-codespaces/new-project.png +0 -0
  102. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/latex-codespaces/new-pub-2.png +0 -0
  103. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/latex-codespaces/new-token.png +0 -0
  104. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/latex-codespaces/paper.tex.png +0 -0
  105. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/latex-codespaces/project-home-3.png +0 -0
  106. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/latex-codespaces/push.png +0 -0
  107. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/latex-codespaces/stage.png +0 -0
  108. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/anakin-excel.jpg +0 -0
  109. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/chart-more-rows.png +0 -0
  110. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/create-project.png +0 -0
  111. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/elsevier-research-data-guidelines.png +0 -0
  112. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/excel-chart.png +0 -0
  113. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/excel-data.png +0 -0
  114. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/insert-link-to-file.png +0 -0
  115. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/needs-clone.png +0 -0
  116. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/new-stage.png +0 -0
  117. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/phd-comics-version-control.webp +0 -0
  118. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/pipeline-out-of-date.png +0 -0
  119. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/status-more-rows.png +0 -0
  120. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/uncommitted-changes.png +0 -0
  121. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/untracked-data.png +0 -0
  122. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/updated-publication.png +0 -0
  123. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/word-to-pdf-stage-2.png +0 -0
  124. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/office/workflow-page.png +0 -0
  125. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/openfoam/clone.png +0 -0
  126. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/openfoam/create-project.png +0 -0
  127. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/openfoam/datasets-page.png +0 -0
  128. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/openfoam/figure-on-website-updated.png +0 -0
  129. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/openfoam/figure-on-website.png +0 -0
  130. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/openfoam/new-token.png +0 -0
  131. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/openfoam/reclone.png +0 -0
  132. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/openfoam/status-after-import-dataset.png +0 -0
  133. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/img/run-proc.png +0 -0
  134. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/index.md +0 -0
  135. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/latex-codespaces.md +0 -0
  136. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/matlab.md +0 -0
  137. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/notebook-pipeline.md +0 -0
  138. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/office.md +0 -0
  139. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/openfoam.md +0 -0
  140. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/tutorials/procedures.md +0 -0
  141. {calkit_python-0.21.4 → calkit_python-0.21.5}/docs/version-control.md +0 -0
  142. {calkit_python-0.21.4 → calkit_python-0.21.5}/mkdocs.yml +0 -0
  143. {calkit_python-0.21.4 → calkit_python-0.21.5}/pyproject.toml +0 -0
  144. {calkit_python-0.21.4 → calkit_python-0.21.5}/test/pipeline.ipynb +0 -0
  145. {calkit_python-0.21.4 → calkit_python-0.21.5}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: calkit-python
3
- Version: 0.21.4
3
+ Version: 0.21.5
4
4
  Summary: Reproducibility simplified.
5
5
  Project-URL: Homepage, https://calkit.org
6
6
  Project-URL: Issues, https://github.com/calkit/calkit/issues
@@ -74,17 +74,19 @@ which is typically a good idea,
74
74
  that should also be installed.
75
75
  For Python, we recommend
76
76
  [Miniforge](https://conda-forge.org/miniforge/).
77
- If you're a Windows user and decide to install Miniforge or any other
78
- Conda-based distribution,
79
- e.g., Anaconda, you'll probably want to ensure that environment is
80
- [activated by default in Git Bash](https://discuss.codecademy.com/t/setting-up-conda-in-git-bash/534473).
81
77
 
82
- After Python is installed, run
78
+ After Python is installed, run:
83
79
 
84
80
  ```sh
85
81
  pip install calkit-python
86
82
  ```
87
83
 
84
+ For Windows users, the
85
+ [Calkit Assistant](https://github.com/calkit/calkit-assistant)
86
+ app is the easiest way to get everything set up and ready to work in
87
+ VS Code, which can then be used as the primary app for working on
88
+ all scientific or analytical computing projects.
89
+
88
90
  ## Cloud integration
89
91
 
90
92
  The Calkit Cloud ([calkit.io](https://calkit.io)) serves as a project
@@ -36,17 +36,19 @@ which is typically a good idea,
36
36
  that should also be installed.
37
37
  For Python, we recommend
38
38
  [Miniforge](https://conda-forge.org/miniforge/).
39
- If you're a Windows user and decide to install Miniforge or any other
40
- Conda-based distribution,
41
- e.g., Anaconda, you'll probably want to ensure that environment is
42
- [activated by default in Git Bash](https://discuss.codecademy.com/t/setting-up-conda-in-git-bash/534473).
43
39
 
44
- After Python is installed, run
40
+ After Python is installed, run:
45
41
 
46
42
  ```sh
47
43
  pip install calkit-python
48
44
  ```
49
45
 
46
+ For Windows users, the
47
+ [Calkit Assistant](https://github.com/calkit/calkit-assistant)
48
+ app is the easiest way to get everything set up and ready to work in
49
+ VS Code, which can then be used as the primary app for working on
50
+ all scientific or analytical computing projects.
51
+
50
52
  ## Cloud integration
51
53
 
52
54
  The Calkit Cloud ([calkit.io](https://calkit.io)) serves as a project
@@ -1,4 +1,4 @@
1
- __version__ = "0.21.4"
1
+ __version__ = "0.21.5"
2
2
 
3
3
  from .core import *
4
4
  from . import git
@@ -104,15 +104,48 @@ def new_project(
104
104
  abs_path = os.path.abspath(path)
105
105
  if template and os.path.exists(abs_path):
106
106
  raise_error("Must specify a new directory if using --template")
107
- if cloud and os.path.isdir(os.path.join(abs_path, ".git")):
108
- raise_error("Must not already be a Git repo to use --cloud")
107
+ try:
108
+ repo = git.Repo(abs_path)
109
+ except InvalidGitRepositoryError:
110
+ repo = None
111
+ if repo is not None and git_repo_url is None:
112
+ try:
113
+ git_repo_url = repo.remotes.origin.url
114
+ # Convert to HTTPS if it's SSH
115
+ if git_repo_url.startswith("git@"):
116
+ git_repo_url = git_repo_url.replace(
117
+ "git@github.com:", "https://github.com/"
118
+ )
119
+ git_repo_url = git_repo_url.removesuffix(".git")
120
+ except Exception as e:
121
+ git_repo_url = None
122
+ raise_error(
123
+ f"Could not detect Git repo URL from existing repo: {e}"
124
+ )
125
+ # If this isn't a DVC repo, run `dvc init`
126
+ if not os.path.isfile(os.path.join(abs_path, ".dvc", "config")):
127
+ typer.echo("Initializing DVC repository")
128
+ try:
129
+ subprocess.run(
130
+ ["dvc", "init", "-q"],
131
+ cwd=abs_path,
132
+ capture_output=True,
133
+ check=True,
134
+ text=True,
135
+ )
136
+ except subprocess.CalledProcessError as e:
137
+ raise_error(f"Failed to initialize DVC repository: {e.stderr}")
138
+ # Commit the DVC init changes
139
+ if not no_commit:
140
+ repo.git.add(".dvc")
141
+ repo.git.commit(["-m", "Initialize DVC"])
109
142
  ck_info_fpath = os.path.join(abs_path, "calkit.yaml")
110
143
  if os.path.isfile(ck_info_fpath) and not overwrite:
111
144
  raise_error(
112
145
  "Destination is already a Calkit project; "
113
146
  "use --overwrite to continue"
114
147
  )
115
- if os.path.isdir(abs_path) and os.listdir(abs_path):
148
+ if os.path.isdir(abs_path) and os.listdir(abs_path) and repo is None:
116
149
  warn(f"{abs_path} is not empty")
117
150
  if name is None:
118
151
  name = calkit.to_kebab_case(os.path.basename(abs_path))
@@ -127,6 +160,7 @@ def new_project(
127
160
  # Cloud should allow None, which will allow us to post just the name
128
161
  # NOTE: This will fail if the user hasn't logged into the Calkit Cloud
129
162
  # in 6 months, since their GitHub refresh token stored is expired
163
+ typer.echo("Creating project in Calkit Cloud")
130
164
  try:
131
165
  resp = calkit.cloud.post(
132
166
  "/projects",
@@ -144,8 +178,8 @@ def new_project(
144
178
  # Now clone here
145
179
  if not os.path.isdir(abs_path):
146
180
  subprocess.run(["git", "clone", resp["git_repo_url"], abs_path])
147
- else:
148
- typer.echo("Fetching from newly create Git repo")
181
+ elif repo is None:
182
+ typer.echo("Fetching from newly created Git repo")
149
183
  repo = git.Repo.init(abs_path, initial_branch="main")
150
184
  repo.git.remote(["add", "origin", resp["git_repo_url"]])
151
185
  repo.git.fetch()
@@ -156,6 +190,25 @@ def new_project(
156
190
  repo.git.checkout(checkout_cmd)
157
191
  except GitCommandError as e:
158
192
  raise_error(f"Failed to check out main branch: {e}")
193
+ else:
194
+ # Create a calkit.yaml file if one does not exist
195
+ calkit_fpath = os.path.join(abs_path, "calkit.yaml")
196
+ if not os.path.isfile(calkit_fpath):
197
+ typer.echo("Creating calkit.yaml file")
198
+ with open(calkit_fpath, "w") as f:
199
+ ryaml.dump(
200
+ dict(
201
+ owner=resp["owner_account_name"],
202
+ name=resp["name"],
203
+ title=resp["title"],
204
+ description=resp["description"],
205
+ git_repo_url=resp["git_repo_url"],
206
+ ),
207
+ f,
208
+ )
209
+ repo.git.add("calkit.yaml")
210
+ if not no_commit:
211
+ repo.git.commit(["-m", "Create calkit.yaml"])
159
212
  try:
160
213
  calkit.dvc.set_remote_auth(wdir=abs_path)
161
214
  except Exception:
@@ -287,8 +340,11 @@ def new_project(
287
340
  # Setup Calkit Cloud DVC remote
288
341
  if repo.remotes:
289
342
  typer.echo("Setting up Calkit Cloud DVC remote")
290
- calkit.dvc.configure_remote(wdir=abs_path)
291
- calkit.dvc.set_remote_auth(wdir=abs_path)
343
+ try:
344
+ calkit.dvc.configure_remote(wdir=abs_path)
345
+ calkit.dvc.set_remote_auth(wdir=abs_path)
346
+ except Exception as e:
347
+ warn(f"Failed to set up Calkit Cloud DVC remote: {e}")
292
348
  if repo.git.diff("--staged") and not no_commit:
293
349
  repo.git.commit(["-m", "Initialize Calkit project"])
294
350
  typer.echo(success_message)
@@ -216,6 +216,40 @@ def test_new_uv_venv(tmp_dir):
216
216
 
217
217
 
218
218
  def test_new_project(tmp_dir):
219
+ subprocess.check_call(
220
+ ["calkit", "new", "project", ".", "--title", "My new project"]
221
+ )
222
+ repo = git.Repo()
223
+ assert repo.git.ls_files("calkit.yaml")
224
+ assert repo.git.ls_files("README.md")
225
+ assert repo.git.ls_files(".devcontainer")
226
+ ck_info = calkit.load_calkit_info()
227
+ assert ck_info["title"] == "My new project"
228
+
229
+
230
+ def test_new_project_existing_repo(tmp_dir):
231
+ subprocess.check_call(["git", "init"])
232
+ subprocess.check_call(
233
+ [
234
+ "git",
235
+ "remote",
236
+ "add",
237
+ "origin",
238
+ "https://github.com/someone/somerepo.git",
239
+ ]
240
+ )
241
+ subprocess.check_call(
242
+ ["calkit", "new", "project", ".", "--title", "My new project"]
243
+ )
244
+ repo = git.Repo()
245
+ assert repo.git.ls_files("calkit.yaml")
246
+ assert repo.git.ls_files("README.md")
247
+ assert repo.git.ls_files(".devcontainer")
248
+ ck_info = calkit.load_calkit_info()
249
+ assert ck_info["title"] == "My new project"
250
+
251
+
252
+ def test_new_project_existing_files(tmp_dir):
219
253
  subprocess.check_call(["touch", "some-existing-file.txt"])
220
254
  subprocess.check_call(
221
255
  ["calkit", "new", "project", ".", "--title", "My new project"]
@@ -0,0 +1,22 @@
1
+ # Installation
2
+
3
+ To install Calkit, [Git](https://git-scm.com) and Python must be installed.
4
+ If you want to use [Docker](https://docker.com) containers,
5
+ which is typically a good idea,
6
+ that should also be installed.
7
+ For Python, we recommend
8
+ [Miniforge](https://conda-forge.org/miniforge/).
9
+
10
+ After Python is installed, execute:
11
+
12
+ ```sh
13
+ pip install calkit-python
14
+ ```
15
+
16
+ For Windows users, the
17
+ [Calkit Assistant](https://github.com/calkit/calkit-assistant)
18
+ app is the easiest way to get everything set up and ready to work in
19
+ VS Code, which can then be used as the primary app for working on
20
+ all scientific or analytical computing projects.
21
+
22
+ ![Calkit Assistant](https://github.com/calkit/calkit-assistant/blob/main/resources/screenshot.png?raw=true)
@@ -1,18 +0,0 @@
1
- # Installation
2
-
3
- To install Calkit, [Git](https://git-scm.com) and Python must be installed.
4
- If you want to use [Docker](https://docker.com) containers,
5
- which is typically a good idea,
6
- that should also be installed.
7
- For Python, we recommend
8
- [Miniforge](https://conda-forge.org/miniforge/).
9
- If you're a Windows user and decide to install Miniforge or any other
10
- Conda-based distribution,
11
- e.g., Anaconda, you'll probably want to ensure that environment is
12
- [activated by default in Git Bash](https://discuss.codecademy.com/t/setting-up-conda-in-git-bash/534473).
13
-
14
- After Python is installed, execute:
15
-
16
- ```sh
17
- pip install calkit-python
18
- ```
File without changes
File without changes
File without changes