From 4deab03cb458bda65543b4247e74dac5932b22c7 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Tue, 6 Feb 2024 21:14:12 +1100 Subject: [PATCH] Some renamings --- MANIFEST.in | 2 +- ...ample_external_package-1.0.0-py3-none-any.whl | Bin 2023 -> 0 bytes .../dist/example_external_package-1.0.0.tar.gz | Bin 945 -> 0 bytes .../README.md | 0 .../external_fixturepkg-1.0.0-py3-none-any.whl | Bin 0 -> 1929 bytes .../dist/external_fixturepkg-1.0.0.tar.gz | Bin 0 -> 941 bytes .../pyproject.toml | 2 +- .../src/external_fixturepkg}/__init__.py | 0 .../src/external_fixturepkg}/__main__.py | 0 .../src/external_fixturepkg/mod1.py} | 0 ropetest/conftest.py | 13 ++++++++++--- ropetest/contrib/autoimport/conftest.py | 12 ++++++------ ropetest/contrib/autoimport/utilstest.py | 4 ++-- ropetest/contrib/autoimporttest.py | 12 ++++++------ 14 files changed, 26 insertions(+), 19 deletions(-) delete mode 100644 ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0-py3-none-any.whl delete mode 100644 ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0.tar.gz rename ropetest-package-fixtures/{example-external-package => external_fixturepkg}/README.md (100%) create mode 100644 ropetest-package-fixtures/external_fixturepkg/dist/external_fixturepkg-1.0.0-py3-none-any.whl create mode 100644 ropetest-package-fixtures/external_fixturepkg/dist/external_fixturepkg-1.0.0.tar.gz rename ropetest-package-fixtures/{example-external-package => external_fixturepkg}/pyproject.toml (92%) rename ropetest-package-fixtures/{example-external-package/src/example_external_package => external_fixturepkg/src/external_fixturepkg}/__init__.py (100%) rename ropetest-package-fixtures/{example-external-package/src/example_external_package => external_fixturepkg/src/external_fixturepkg}/__main__.py (100%) rename ropetest-package-fixtures/{example-external-package/src/example_external_package/example_module.py => external_fixturepkg/src/external_fixturepkg/mod1.py} (100%) diff --git a/MANIFEST.in b/MANIFEST.in index fbf55fd3..c6e77775 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -include README.rst COPYING setup.py MANIFEST.in CHANGELOG.md ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0.tar.gz ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0-py3-none-any.whl +include README.rst COPYING setup.py MANIFEST.in CHANGELOG.md ropetest-package-fixtures/external_fixturepkg/dist/external_fixturepkg-1.0.0-py3-none-any.whl ropetest-package-fixtures/external_fixturepkg/dist/external_fixturepkg-1.0.0.tar.gz recursive-include rope *.py recursive-include docs *.rst recursive-include ropetest *.py diff --git a/ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0-py3-none-any.whl b/ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0-py3-none-any.whl deleted file mode 100644 index a62fffbafb47b83302a39e873169f3e931fc7014..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2023 zcmWIWW@Zs#U|`^2*ge@TLiMA{QUxFngjIkzwIVUMASX3GwW1`oC@(Q5z92C~ zKR!M)FS8^*Uaz3i+tW8#!|#ml3C~`C?X%u`C(oR}d|}I@Acm%HfZ`~P_)*nCi9JzDlM+IwiH0#$N z6%!u)s3`5w>hMFi-0hrRB`?roZXnhIVw~QCN#y3Il;)&@JbC(j_=ZrB)lZp_e8j+@ z=pmcbcM9YqTOhW?W2mm7o&gZ1WEPj`X6B{k>!;?G6jjC-Akx=q!VLLlDp^0jIv8B&a)FL&fh)i8p)T**9T2mxM>h-gy&zHVZ zdlp*6h~~PQoXw3NfUYWIWMD8P#dW@}A&xGNA&#Z}w*H45c-qSUb9oy~+S1CXDWqed z*eDRPrgwJn-7B!U6AIjdsub1#`C8#c9#t%^oZ_TvcltC%n^luv!#!gZrc0kTvoZn*__MK zM|;IX`m$oX6+J&peArw+Nwn|i?-h4lDryew{vq8* zE^0DhXnnZ%yimxxORnNkO#w~fB3E*ZI27G>hA!&xzn?cJQ~cZ&%hSf6>%WMJm-=z; z<*d?sJm*SbQJ18wz#(rvj+fVEGx#Enh<>ZQ{;as*uj=T--8ygP^fd&qvK>$Ih2>yP{`T=r!N1^EnYM7l?%CBFud5$2EC05!(Lpxz ze>>9;Lw+5Gs`~-nj7%cTxXV>wyn(@zMi2!nZSa+{=q93e8b!7CzaJ&p&g#_5 zgBJs9?|F$KQYIQZ;~ z{>9JF-@c$_er){5VR$h9{V>{#|1ge|0k|0d56%y;odK0rfAY)_@|%4mz~r_7HU%(O z8Vs+EkPFbN;*=2bLBUNUiX6;R)UcU5PeC_wOvr3DyJ7W`{0P}$6r_TKiE z1(#ei`?cGfYY-Av&t3NfW zEFQ@JaTM&uzfC~V|0m(P6S7mUYs1Sa(fqGQXe;3fTo31kFixg4hi4NA==pF;`r0>k zj&PaVN?o0_twXyaR*4}Y*PBT*C6blAt#)Xd4aq02YhiN(TdA9JLz444)1oq)tB2B& zwmk!%g<1AV#i;Gd7fDLh=t|YL4Q=Jt_hXmO4tGO!Hpz)C?S`4y0pz^0bav|Mx$UT@o<_(=08jt`@b>S; diff --git a/ropetest-package-fixtures/example-external-package/README.md b/ropetest-package-fixtures/external_fixturepkg/README.md similarity index 100% rename from ropetest-package-fixtures/example-external-package/README.md rename to ropetest-package-fixtures/external_fixturepkg/README.md diff --git a/ropetest-package-fixtures/external_fixturepkg/dist/external_fixturepkg-1.0.0-py3-none-any.whl b/ropetest-package-fixtures/external_fixturepkg/dist/external_fixturepkg-1.0.0-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..ba7951d5f88f1ce884394f539c42b9c5c19289d1 GIT binary patch literal 1929 zcmWIWW@Zs#U|`^2*ge@TLiMA{QUxFngyn%awW1`oC@(Q5J}tANq_iltAUj<@K0Y%q zvm`!Vub|S~(>GYd?~LvV&t8A+v)+0q&z!$}VauZ+hNh+?kCOBl0#FQJ-|VJj4K&mh zui?3gnR#%-PxziWbNNEZg{{FKPM`PQ3O8AA-5HbCA3ydSxpU=51#5IP>(?I@6CVAj zDDBYd@I$xP?VMgEFVIeIAeIJVY@W)^P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xm|IcktL0(??S!-YR^%dSmwFJLz>R^@U@Yp8jO~FC|f{w~_I{ZSw$c zMkWzv+{Gj?vcOjg(Diwi%yMq(E3DA9+s?_j4Z~r4^}e}I!-z&byy_i*+B#0rQ4jd#;VZ|DWXpUeR<1T&U(5qaLJ|(%y?Xxg?JH81 zdx`%vj&F_sC{C`$|1e8v4~G!{cg}B^uUMs*Jl95jO)WsH>W_|RD8!LQT;LF=7*GDC{g%R3quHKf3 zG>>xlvv7+ppBOZ)_$EKmwb9D*zV8q#yC!V&+5Wbd!6q;9rEL#0-}aJg-!(1^(TxJ0 zT=j=^t+Nxf4UV8ofBYx3Z%Ce3OvpSRap}xjDpl5DjKgo^KcaDxfd3Cc$!FMhKLE^XSv2N-_-KT%M>A_-6@dLe?Eml0 z{(tNLczB#a?1TSz`oG)Z?9cx+Om6t!rv%{t1Np!CJ|8~9!Bc#qB>zhO2#Fca^JWvD z=XgBE4=%s_2VJf1PFN_w|3Byd;Z6Tj@c%*lpY8O2n!yhM;QyWeuT)8Y-2Fea|EJgD zKMIp11^*v{nNoP%dLQB);{WUTKmGg9;PuHL|Ln*A-;4hwrPu%elVp(pAB4Buv649! z{M#MIjc`OLI`J9*2=AC1Xj`qFBa#@XfALo)SY-hK000000000000000000000000000000 P*cV>_UIt#l08jt`p+)8U literal 0 HcmV?d00001 diff --git a/ropetest-package-fixtures/example-external-package/pyproject.toml b/ropetest-package-fixtures/external_fixturepkg/pyproject.toml similarity index 92% rename from ropetest-package-fixtures/example-external-package/pyproject.toml rename to ropetest-package-fixtures/external_fixturepkg/pyproject.toml index 28a5e6f3..6dcae495 100644 --- a/ropetest-package-fixtures/example-external-package/pyproject.toml +++ b/ropetest-package-fixtures/external_fixturepkg/pyproject.toml @@ -3,7 +3,7 @@ requires = ["flit-core >= 3.8"] build-backend = "flit_core.buildapi" [project] -name = "example_external_package" +name = "external_fixturepkg" version = "1.0.0" description = "Just an example project built with build/flit for testing purpose" readme = "README.md" diff --git a/ropetest-package-fixtures/example-external-package/src/example_external_package/__init__.py b/ropetest-package-fixtures/external_fixturepkg/src/external_fixturepkg/__init__.py similarity index 100% rename from ropetest-package-fixtures/example-external-package/src/example_external_package/__init__.py rename to ropetest-package-fixtures/external_fixturepkg/src/external_fixturepkg/__init__.py diff --git a/ropetest-package-fixtures/example-external-package/src/example_external_package/__main__.py b/ropetest-package-fixtures/external_fixturepkg/src/external_fixturepkg/__main__.py similarity index 100% rename from ropetest-package-fixtures/example-external-package/src/example_external_package/__main__.py rename to ropetest-package-fixtures/external_fixturepkg/src/external_fixturepkg/__main__.py diff --git a/ropetest-package-fixtures/example-external-package/src/example_external_package/example_module.py b/ropetest-package-fixtures/external_fixturepkg/src/external_fixturepkg/mod1.py similarity index 100% rename from ropetest-package-fixtures/example-external-package/src/example_external_package/example_module.py rename to ropetest-package-fixtures/external_fixturepkg/src/external_fixturepkg/mod1.py diff --git a/ropetest/conftest.py b/ropetest/conftest.py index a89c42cd..47515d31 100644 --- a/ropetest/conftest.py +++ b/ropetest/conftest.py @@ -50,7 +50,14 @@ def mod2(project, pkg1) -> resources.Folder: @pytest.fixture(scope="session") -def example_external_package(): - check_call([sys.executable, "-m", "pip", "install", "--force-reinstall", "ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0-py3-none-any.whl"]) +def external_fixturepkg(): + check_call([ + sys.executable, + "-m", + "pip", + "install", + "--force-reinstall", + "ropetest-package-fixtures/external_fixturepkg/dist/external_fixturepkg-1.0.0-py3-none-any.whl", + ]) yield - check_call([sys.executable, "-m", "pip", "uninstall", "--yes", "example-external-package"]) + check_call([sys.executable, "-m", "pip", "uninstall", "--yes", "external-fixturepkg"]) diff --git a/ropetest/contrib/autoimport/conftest.py b/ropetest/contrib/autoimport/conftest.py index 670e0db5..29bcba4c 100644 --- a/ropetest/contrib/autoimport/conftest.py +++ b/ropetest/contrib/autoimport/conftest.py @@ -24,18 +24,18 @@ def typing_path(): @pytest.fixture -def example_external_package_module_path(example_external_package): - from example_external_package import example_module - yield pathlib.Path(example_module.__file__) +def example_external_package_module_path(external_fixturepkg): + from external_fixturepkg import mod1 + yield pathlib.Path(mod1.__file__) @pytest.fixture -def example_external_package_path(example_external_package): - import example_external_package +def example_external_package_path(external_fixturepkg): + import external_fixturepkg # Uses __init__.py so we need the parent - yield pathlib.Path(example_external_package.__file__).parent + yield pathlib.Path(external_fixturepkg.__file__).parent @pytest.fixture diff --git a/ropetest/contrib/autoimport/utilstest.py b/ropetest/contrib/autoimport/utilstest.py index c6ca5b3d..511e1a54 100644 --- a/ropetest/contrib/autoimport/utilstest.py +++ b/ropetest/contrib/autoimport/utilstest.py @@ -18,7 +18,7 @@ def test_get_package_source_pytest(example_external_package_path): # pytest is not installed as part of the standard library # but should be installed into site_packages, # so it should return Source.SITE_PACKAGE - source = utils.get_package_source(example_external_package_path, None, "example_module") + source = utils.get_package_source(example_external_package_path, None, "mod1") assert source == Source.SITE_PACKAGE @@ -42,7 +42,7 @@ def test_get_modname_folder( example_external_package_module_path, example_external_package_path, ) - assert modname == "example_external_package.example_module" + assert modname == "external_fixturepkg.mod1" def test_get_package_tuple_sample(project_path): diff --git a/ropetest/contrib/autoimporttest.py b/ropetest/contrib/autoimporttest.py index 0fc04293..d74135ff 100644 --- a/ropetest/contrib/autoimporttest.py +++ b/ropetest/contrib/autoimporttest.py @@ -177,14 +177,14 @@ def test_skipping_directories_not_accessible_because_of_permission_error(self): self.assertGreater(len(self.importer._dump_all()), 0) -def test_search_submodule(example_external_package): +def test_search_submodule(external_fixturepkg): project = testutils.sample_project(extension_modules=["sys"]) importer = autoimport.AutoImport(project, observe=False) - importer.update_module("example_external_package") - import_statement = ("from example_external_package import example_module", "example_module") - assert import_statement in importer.search("example_module", exact_match=True) - assert import_statement in importer.search("exam") - assert import_statement in importer.search("example_module") + importer.update_module("external_fixturepkg") + import_statement = ("from external_fixturepkg import mod1", "mod1") + assert import_statement in importer.search("mod1", exact_match=True) + assert import_statement in importer.search("mo") + assert import_statement in importer.search("mod1") class AutoImportObservingTest(unittest.TestCase):