1111
1212from libvcs import exc
1313from libvcs ._internal .run import run , which
14+ from libvcs ._internal .shortcuts import create_project
1415from libvcs .conftest import CreateProjectCallbackFixtureProtocol
1516from libvcs .projects .git import (
1617 GitFullRemoteDict ,
1920 GitStatus ,
2021 convert_pip_url as git_convert_pip_url ,
2122)
22- from libvcs .shortcuts import create_project_from_pip_url
2323
2424if not which ("git" ):
2525 pytestmark = pytest .mark .skip (reason = "git is not available" )
3939 lambda bare_dir , tmp_path , ** kwargs : {
4040 "url" : f"file://{ bare_dir } " ,
4141 "dir" : tmp_path / "obtaining a bare repo" ,
42+ "vcs" : "git" ,
4243 },
4344 ],
4445 [
45- create_project_from_pip_url ,
46+ create_project ,
4647 lambda bare_dir , tmp_path , ** kwargs : {
47- "pip_url " : f"git+file://{ bare_dir } " ,
48+ "url " : f"git+file://{ bare_dir } " ,
4849 "dir" : tmp_path / "obtaining a bare repo" ,
50+ "vcs" : "git" ,
4951 },
5052 ],
5153 ],
@@ -80,13 +82,15 @@ def test_repo_git_obtain_initial_commit_repo(
8082 lambda git_remote_repo , tmp_path , ** kwargs : {
8183 "url" : f"file://{ git_remote_repo } " ,
8284 "dir" : tmp_path / "myrepo" ,
85+ "vcs" : "git" ,
8386 },
8487 ],
8588 [
86- create_project_from_pip_url ,
89+ create_project ,
8790 lambda git_remote_repo , tmp_path , ** kwargs : {
88- "pip_url " : f"git+file://{ git_remote_repo } " ,
91+ "url " : f"git+file://{ git_remote_repo } " ,
8992 "dir" : tmp_path / "myrepo" ,
93+ "vcs" : "git" ,
9094 },
9195 ],
9296 ],
@@ -115,13 +119,15 @@ def test_repo_git_obtain_full(
115119 lambda git_remote_repo , tmp_path , ** kwargs : {
116120 "url" : f"file://{ git_remote_repo } " ,
117121 "dir" : tmp_path / "myrepo" ,
122+ "vcs" : "git" ,
118123 },
119124 ],
120125 [
121- create_project_from_pip_url ,
126+ create_project ,
122127 lambda git_remote_repo , tmp_path , ** kwargs : {
123- "pip_url " : f"git+file://{ git_remote_repo } " ,
128+ "url " : f"git+file://{ git_remote_repo } " ,
124129 "dir" : tmp_path / "myrepo" ,
130+ "vcs" : "git" ,
125131 },
126132 ],
127133 ],
@@ -158,14 +164,16 @@ def test_repo_update_handle_cases(
158164 "url" : f"file://{ git_remote_repo } " ,
159165 "dir" : tmp_path / "myrepo" ,
160166 "progress_callback" : progress_callback ,
167+ "vcs" : "git" ,
161168 },
162169 ],
163170 [
164- create_project_from_pip_url ,
171+ create_project ,
165172 lambda git_remote_repo , tmp_path , progress_callback , ** kwargs : {
166- "pip_url " : f"git+file://{ git_remote_repo } " ,
173+ "url " : f"git+file://{ git_remote_repo } " ,
167174 "dir" : tmp_path / "myrepo" ,
168175 "progress_callback" : progress_callback ,
176+ "vcs" : "git" ,
169177 },
170178 ],
171179 ],
@@ -272,6 +280,7 @@ def progress_callback_spy(output, timestamp):
272280 lambda git_remote_repo , projects_path , repo_name , ** kwargs : {
273281 "url" : f"file://{ git_remote_repo } " ,
274282 "dir" : projects_path / repo_name ,
283+ "vcs" : "git" ,
275284 "remotes" : {
276285 "second_remote" : GitRemote (
277286 name = "second_remote" ,
@@ -285,10 +294,11 @@ def progress_callback_spy(output, timestamp):
285294 },
286295 ],
287296 [
288- create_project_from_pip_url ,
297+ create_project ,
289298 lambda git_remote_repo , projects_path , repo_name , ** kwargs : {
290- "pip_url " : f"git+file://{ git_remote_repo } " ,
299+ "url " : f"git+file://{ git_remote_repo } " ,
291300 "dir" : projects_path / repo_name ,
301+ "vcs" : "git" ,
292302 },
293303 lambda git_remote_repo , ** kwargs : {"origin" : f"file://{ git_remote_repo } " },
294304 ],
@@ -472,13 +482,15 @@ def test_git_get_url_and_rev_from_pip_url():
472482 lambda git_remote_repo , dir , ** kwargs : {
473483 "url" : f"file://{ git_remote_repo } " ,
474484 "dir" : str (dir ),
485+ "vcs" : "git" ,
475486 },
476487 ],
477488 [
478- create_project_from_pip_url ,
489+ create_project ,
479490 lambda git_remote_repo , dir , ** kwargs : {
480- "pip_url " : f"git+file://{ git_remote_repo } " ,
491+ "url " : f"git+file://{ git_remote_repo } " ,
481492 "dir" : dir ,
493+ "vcs" : "git" ,
482494 },
483495 ],
484496 ],
@@ -514,13 +526,15 @@ def test_remotes_preserves_git_ssh(
514526 lambda bare_dir , tmp_path , ** kwargs : {
515527 "url" : f"file://{ bare_dir } " ,
516528 "dir" : tmp_path / "obtaining a bare repo" ,
529+ "vcs" : "git" ,
517530 },
518531 ],
519532 [
520- create_project_from_pip_url ,
533+ create_project ,
521534 lambda bare_dir , tmp_path , ** kwargs : {
522- "pip_url " : f"git+file://{ bare_dir } " ,
535+ "url " : f"git+file://{ bare_dir } " ,
523536 "dir" : tmp_path / "obtaining a bare repo" ,
537+ "vcs" : "git" ,
524538 },
525539 ],
526540 ],
@@ -530,14 +544,15 @@ def test_private_ssh_format(
530544 constructor : ProjectTestFactory ,
531545 lazy_constructor_options : ProjectTestFactoryLazyKwargs ,
532546):
533- pip_url_kwargs = {
534- "pip_url" : "git+ssh://github.com:/tmp/omg/private_ssh_repo" ,
535- "dir" : tmpdir ,
536- }
537-
538547 with pytest .raises (exc .LibVCSException ) as excinfo :
539- create_project_from_pip_url (** pip_url_kwargs )
540- excinfo .match (r"is malformatted" )
548+ create_project (
549+ url = git_convert_pip_url (
550+ "git+ssh://github.com:/tmp/omg/private_ssh_repo"
551+ ).url ,
552+ dir = tmpdir ,
553+ vcs = "git" ,
554+ )
555+ excinfo .match (r".*is a malformed.*" )
541556
542557
543558def test_ls_remotes (git_repo : GitProject ):
0 commit comments