From 103681e46d01d9aeec243328830f93922921bd07 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Tue, 6 Feb 2024 18:14:49 +1100 Subject: [PATCH 1/8] Use sys.base_prefix to detect stdlib prefix This seems more reliable than sys.prefix on certain virtualenv configuration. --- rope/contrib/autoimport/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rope/contrib/autoimport/utils.py b/rope/contrib/autoimport/utils.py index d61bac6c..a16efba0 100644 --- a/rope/contrib/autoimport/utils.py +++ b/rope/contrib/autoimport/utils.py @@ -54,7 +54,7 @@ def get_package_source( if "site-packages" in package.parts: return Source.SITE_PACKAGE if sys.version_info < (3, 10, 0): - if str(package).startswith(sys.prefix): + if str(package).startswith(sys.base_prefix): return Source.STANDARD else: if name in sys.stdlib_module_names: From c27b90cea7d2019aedaca204b9a4b02c57925892 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Tue, 6 Feb 2024 20:11:13 +1100 Subject: [PATCH 2/8] Remove duplicated fixture --- ropetest/conftest.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ropetest/conftest.py b/ropetest/conftest.py index ce8a1eab..32a35aaa 100644 --- a/ropetest/conftest.py +++ b/ropetest/conftest.py @@ -13,13 +13,6 @@ def project(): testutils.remove_project(project) -@pytest.fixture -def project2(): - project = testutils.sample_project("another_project") - yield project - testutils.remove_project(project) - - @pytest.fixture def project_path(project): yield pathlib.Path(project.address) From 7b949db5a22eadabbd8f132d0bc934d369b4c787 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Tue, 6 Feb 2024 20:23:15 +1100 Subject: [PATCH 3/8] Formatting cleanups --- ropetest/contrib/autoimport/utilstest.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/ropetest/contrib/autoimport/utilstest.py b/ropetest/contrib/autoimport/utilstest.py index acf2fb9e..ca003430 100644 --- a/ropetest/contrib/autoimport/utilstest.py +++ b/ropetest/contrib/autoimport/utilstest.py @@ -22,17 +22,14 @@ def test_get_package_source_pytest(build_path): def test_get_package_source_typing(typing_path): - assert utils.get_package_source(typing_path, None, "typing") == Source.STANDARD def test_get_modname_project_no_add(mod1_path, project_path): - assert utils.get_modname_from_path(mod1_path, project_path, False) == "mod1" def test_get_modname_single_file(typing_path): - assert utils.get_modname_from_path(typing_path, typing_path) == "typing" From fc28f57dff9c898f430bf672665da2bed8ba78f1 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Tue, 6 Feb 2024 20:33:34 +1100 Subject: [PATCH 4/8] Create ropetest-package-fixtures --- .gitignore | 2 +- .../example-external-package/CHANGELOG.rst | 9 + .../example-external-package/LICENSE | 165 ++++++++++++++++++ .../example-external-package/README.md | 12 ++ ...le_external_package-1.0.0-py3-none-any.whl | Bin 0 -> 4865 bytes .../example_external_package-1.0.0.tar.gz | Bin 0 -> 3697 bytes .../example-external-package/pyproject.toml | 20 +++ .../src/example_external_package/__init__.py | 2 + .../src/example_external_package/__main__.py | 6 + .../example_module.py | 1 + ropetest/conftest.py | 9 + 11 files changed, 225 insertions(+), 1 deletion(-) create mode 100644 ropetest-package-fixtures/example-external-package/CHANGELOG.rst create mode 100644 ropetest-package-fixtures/example-external-package/LICENSE create mode 100644 ropetest-package-fixtures/example-external-package/README.md create mode 100644 ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0-py3-none-any.whl create mode 100644 ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0.tar.gz create mode 100644 ropetest-package-fixtures/example-external-package/pyproject.toml create mode 100644 ropetest-package-fixtures/example-external-package/src/example_external_package/__init__.py create mode 100644 ropetest-package-fixtures/example-external-package/src/example_external_package/__main__.py create mode 100644 ropetest-package-fixtures/example-external-package/src/example_external_package/example_module.py diff --git a/.gitignore b/.gitignore index 15b8071c..ce320e7e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ __pycache__/ .Python build/ develop-eggs/ -dist/ +/dist/ downloads/ eggs/ .eggs/ diff --git a/ropetest-package-fixtures/example-external-package/CHANGELOG.rst b/ropetest-package-fixtures/example-external-package/CHANGELOG.rst new file mode 100644 index 00000000..b2526c25 --- /dev/null +++ b/ropetest-package-fixtures/example-external-package/CHANGELOG.rst @@ -0,0 +1,9 @@ ++++++++++ +Changelog ++++++++++ + + +next release +============ + +Just an example package for testing diff --git a/ropetest-package-fixtures/example-external-package/LICENSE b/ropetest-package-fixtures/example-external-package/LICENSE new file mode 100644 index 00000000..0a041280 --- /dev/null +++ b/ropetest-package-fixtures/example-external-package/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/ropetest-package-fixtures/example-external-package/README.md b/ropetest-package-fixtures/example-external-package/README.md new file mode 100644 index 00000000..d6f5f60d --- /dev/null +++ b/ropetest-package-fixtures/example-external-package/README.md @@ -0,0 +1,12 @@ +# example_project + +Just an example project for testing rope. + + +To build this package, run: + +```bash +$ python -m build +``` + +This generates packages in `dist` folder. 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 new file mode 100644 index 0000000000000000000000000000000000000000..28b23b8dfbc5c656ab2a4e1da63a1a40b0458f6a GIT binary patch literal 4865 zcmb7|2T)V((#J#ZJv0%d8+uo&ND0LVga8WC1OW-sq$Y|~K?s6$1Vw3qP$NN*7D0;A zJ19*sGyy3=L7H&!-p^M*=e_S8&oet`o;h=V|K0PP+1Xtvgp3>r005`~ZV&V>&K3#iNaX6-OM0r`IcuWH=V4J2vrS z`>)~sc;MmXswCwS6g8TYO z!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qf`E;3Bm8g-)8{-;Q;{oVUGVy{A(icEAj6d`=7+= zeH{;xLwSMJ~S_CL9b$G`rM*ME=we|Gx6%KTl!{!`}lpUC`Q`~EBa@6zy3x-tD9 z1o7{r{5$*iB>I#6=}*`{QtI#c-;>NwyaeMPxc;A%1BFmfeg{w=ud(B-#mfAB_b-?J BGr|A> literal 0 HcmV?d00001 diff --git a/ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0.tar.gz b/ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1b1f6dbe08a0b31fff3029a30cbb1c80c7d92896 GIT binary patch literal 3697 zcmV-%4vz63iwFpS!G%@=|7Cb#ZE$R5UuAf7WpZv|Y+rC;V{2h&Wi2r-FfK4IbYXG; z?OSbg+qe^km?TkA|n?$7Aux(XXD=M?YRhYN9?C zDogxmvh;%w{#+dly@5A4y!ih7^^41^A76M`Ufd`CPsZb&@jpB|?Zp2vT=0<`xcL9- z^oNSX#llbKDoW>K^Gt{Yjv+G@DL+@@X@i9L0jiUJBCQKa>p60kX0lLup_92wA^+>- zx%%(w|K0lkWb}CCg4fmmtCts-uWv5zAOE}S|M28=+>QV7_-Nqj|3i?xOD|skB(E-S zZZ6-*7niRu-<)5`>!1D%PmtCdgxpSlRavgnL>~3!=!yKHOq3iA2B$*Ei*&ip^n6js zy^DQ*D4%Ca$(wXmto%&L=V_UQeu3G2`7#MS`Nu_3Ec3I&!&yG_(rkYCosgHeDqE-E zs&lziS*(jfg|bLx0QNv4p$v6iWO`Z_N@DC33}bq!RW4*Ylf?ovBORzDS29e4GFC~^ zml!VtLO(z(QWwNNNdax5C|#-00}7JzEls_(8)R0>C`#qI%H#``sLYS#bvXrpd1cqo zNswmCH1mOn1WiGZ#W{-_q)Di0!#T05I3G26x0wpdv@i2=iI64PvHj_q$NQn-hT*K5 zJZIJs6hec5>sB7^W8lg2&Cq9RrV}Ftzdg@onPdDyWlF;oJ=U0AxCb0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^39bGyc?ozO!{X!1e#G{{Qys|H+dlCoc9~{r^n;H{HyA z>;G_Y+^zqkQ`i4LSp6p}?(NHi@8s(=QH|m+gr3RCgqrxtL_U2gzo|_AjTvQTx~`W7$c>O&Q02wmy^hzN!;%s!O?RzLYyNH;<>{+2&60;37@v2So>O*GmXl zK)ORL{~=6Qi4gx6-!r*X>&THKM~)mha^%R7BS(%LIdbI4kt0Wr96562$dMyQjvP7q PFVepOH(~#E0C)fZXM{^( literal 0 HcmV?d00001 diff --git a/ropetest-package-fixtures/example-external-package/pyproject.toml b/ropetest-package-fixtures/example-external-package/pyproject.toml new file mode 100644 index 00000000..9208649f --- /dev/null +++ b/ropetest-package-fixtures/example-external-package/pyproject.toml @@ -0,0 +1,20 @@ +[build-system] +requires = ["flit-core >= 3.8"] +build-backend = "flit_core.buildapi" + +[project] +name = "example_external_package" +version = "1.0.0" +description = "Just an example project built with build/flit for testing purpose" +readme = "README.md" +requires-python = ">= 3.7" +license.file = "LICENSE" + +dependencies = [ ] + +[project.scripts] +pyproject-build = "build.__main__:entrypoint" + +[tool.flit.sdist] +include = ["CHANGELOG.rst"] +exclude = ["**/__pycache__", "**/*.egg-info"] diff --git a/ropetest-package-fixtures/example-external-package/src/example_external_package/__init__.py b/ropetest-package-fixtures/example-external-package/src/example_external_package/__init__.py new file mode 100644 index 00000000..8cf1e00f --- /dev/null +++ b/ropetest-package-fixtures/example-external-package/src/example_external_package/__init__.py @@ -0,0 +1,2 @@ +def sample_function(): + pass diff --git a/ropetest-package-fixtures/example-external-package/src/example_external_package/__main__.py b/ropetest-package-fixtures/example-external-package/src/example_external_package/__main__.py new file mode 100644 index 00000000..e6d098de --- /dev/null +++ b/ropetest-package-fixtures/example-external-package/src/example_external_package/__main__.py @@ -0,0 +1,6 @@ +def main() -> None: + pass + + +if __name__ == '__main__': + main() diff --git a/ropetest-package-fixtures/example-external-package/src/example_external_package/example_module.py b/ropetest-package-fixtures/example-external-package/src/example_external_package/example_module.py new file mode 100644 index 00000000..3c74911b --- /dev/null +++ b/ropetest-package-fixtures/example-external-package/src/example_external_package/example_module.py @@ -0,0 +1 @@ +foo = None diff --git a/ropetest/conftest.py b/ropetest/conftest.py index 32a35aaa..a89c42cd 100644 --- a/ropetest/conftest.py +++ b/ropetest/conftest.py @@ -1,4 +1,6 @@ import pathlib +import sys +from subprocess import check_call import pytest @@ -45,3 +47,10 @@ def pkg1(project) -> resources.Folder: @pytest.fixture def mod2(project, pkg1) -> resources.Folder: return testutils.create_module(project, "mod2", pkg1) + + +@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"]) + yield + check_call([sys.executable, "-m", "pip", "uninstall", "--yes", "example-external-package"]) From 19d288d3d923998da80d51d04fa63d00b4369fc7 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Tue, 6 Feb 2024 20:35:55 +1100 Subject: [PATCH 5/8] Remove dependencies on `build` package while running tests --- MANIFEST.in | 2 +- pyproject.toml | 1 + ropetest/contrib/autoimport/conftest.py | 13 ++++++------- ropetest/contrib/autoimport/utilstest.py | 17 ++++++++++++----- ropetest/contrib/autoimporttest.py | 17 ++++++++++------- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 86e75b33..fbf55fd3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -include README.rst COPYING setup.py MANIFEST.in CHANGELOG.md +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 recursive-include rope *.py recursive-include docs *.rst recursive-include ropetest *.py diff --git a/pyproject.toml b/pyproject.toml index 0df77c25..276938f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,6 +87,7 @@ profile = "black" [tool.pytest.ini_options] +testpaths = "ropetest" python_files = [ "*test.py", "__init__.py", diff --git a/ropetest/contrib/autoimport/conftest.py b/ropetest/contrib/autoimport/conftest.py index a3291304..670e0db5 100644 --- a/ropetest/contrib/autoimport/conftest.py +++ b/ropetest/contrib/autoimport/conftest.py @@ -24,19 +24,18 @@ def typing_path(): @pytest.fixture -def build_env_path(): - from build import env - - yield pathlib.Path(env.__file__) +def example_external_package_module_path(example_external_package): + from example_external_package import example_module + yield pathlib.Path(example_module.__file__) @pytest.fixture -def build_path(): - import build +def example_external_package_path(example_external_package): + import example_external_package # Uses __init__.py so we need the parent - yield pathlib.Path(build.__file__).parent + yield pathlib.Path(example_external_package.__file__).parent @pytest.fixture diff --git a/ropetest/contrib/autoimport/utilstest.py b/ropetest/contrib/autoimport/utilstest.py index ca003430..c6ca5b3d 100644 --- a/ropetest/contrib/autoimport/utilstest.py +++ b/ropetest/contrib/autoimport/utilstest.py @@ -14,11 +14,12 @@ def test_get_package_source_not_project(mod1_path): assert utils.get_package_source(mod1_path, None, "") == Source.UNKNOWN -def test_get_package_source_pytest(build_path): +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 - assert utils.get_package_source(build_path, None, "build") == Source.SITE_PACKAGE + source = utils.get_package_source(example_external_package_path, None, "example_module") + assert source == Source.SITE_PACKAGE def test_get_package_source_typing(typing_path): @@ -33,9 +34,15 @@ def test_get_modname_single_file(typing_path): assert utils.get_modname_from_path(typing_path, typing_path) == "typing" -def test_get_modname_folder(build_path, build_env_path): - - assert utils.get_modname_from_path(build_env_path, build_path) == "build.env" +def test_get_modname_folder( + example_external_package_path, + example_external_package_module_path, +): + modname = utils.get_modname_from_path( + example_external_package_module_path, + example_external_package_path, + ) + assert modname == "example_external_package.example_module" def test_get_package_tuple_sample(project_path): diff --git a/ropetest/contrib/autoimporttest.py b/ropetest/contrib/autoimporttest.py index d2f481da..0fc04293 100644 --- a/ropetest/contrib/autoimporttest.py +++ b/ropetest/contrib/autoimporttest.py @@ -111,13 +111,6 @@ def test_handling_builtin_modules(self): self.importer.update_module("sys") self.assertIn("sys", self.importer.get_modules("exit")) - def test_search_submodule(self): - self.importer.update_module("build") - import_statement = ("from build import env", "env") - self.assertIn(import_statement, self.importer.search("env", exact_match=True)) - self.assertIn(import_statement, self.importer.search("en")) - self.assertIn(import_statement, self.importer.search("env")) - def test_search_module(self): self.importer.update_module("os") import_statement = ("import os", "os") @@ -184,6 +177,16 @@ 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): + 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") + + class AutoImportObservingTest(unittest.TestCase): def setUp(self): super().setUp() From 6df0dbfb6107ba2b0c589d784c7d929f7cddea5e Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Tue, 6 Feb 2024 20:53:33 +1100 Subject: [PATCH 6/8] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09ccfc28..4b262f24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # **Upcoming release** - #730 Match on module aliases for autoimport suggestions +- #755 Remove dependency on `build` package being installed while running tests # Release 1.12.0 From a7460c4c495582581a8008f9f99186a70156fd17 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Tue, 6 Feb 2024 20:56:07 +1100 Subject: [PATCH 7/8] Remove files that are not necessary for example-external-package --- .../example-external-package/CHANGELOG.rst | 9 - .../example-external-package/LICENSE | 165 ------------------ ...le_external_package-1.0.0-py3-none-any.whl | Bin 4865 -> 2023 bytes .../example_external_package-1.0.0.tar.gz | Bin 3697 -> 945 bytes .../example-external-package/pyproject.toml | 2 - 5 files changed, 176 deletions(-) delete mode 100644 ropetest-package-fixtures/example-external-package/CHANGELOG.rst delete mode 100644 ropetest-package-fixtures/example-external-package/LICENSE diff --git a/ropetest-package-fixtures/example-external-package/CHANGELOG.rst b/ropetest-package-fixtures/example-external-package/CHANGELOG.rst deleted file mode 100644 index b2526c25..00000000 --- a/ropetest-package-fixtures/example-external-package/CHANGELOG.rst +++ /dev/null @@ -1,9 +0,0 @@ -+++++++++ -Changelog -+++++++++ - - -next release -============ - -Just an example package for testing diff --git a/ropetest-package-fixtures/example-external-package/LICENSE b/ropetest-package-fixtures/example-external-package/LICENSE deleted file mode 100644 index 0a041280..00000000 --- a/ropetest-package-fixtures/example-external-package/LICENSE +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. 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 index 28b23b8dfbc5c656ab2a4e1da63a1a40b0458f6a..a62fffbafb47b83302a39e873169f3e931fc7014 100644 GIT binary patch delta 542 zcmZovd(O`j;LXe;!oa}5!LWPsM4kjDAemPUB40n<9KrLDk=LQV**1-lfuWs=fkA)r zLq?tYAXjJqAeX6UPZu>AFtk40dtNAH-6dD?sHT7>agi%IMjVQ6J3|+B_}|Z)lPP}g zisfnJ&-Gu##7q4+_i|S0J)U!=u&7H?R^X7g9>>e;vKf3E7fHWArSoN4w&lk;&eN8v zYp?pGxKT*g$?z-p%NNRzR_5&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mu$t$&)81F7{ph|4jWi-OPRK|8Q{Jt^cD_*Z)6Q z{U~`W7$c> zO&Q02wmy^hzF(>nZ>meVYrd2_GdGW?;@Rd-@Zcg%=m$jyZ`Vr*SwOl&EdL=)SBVh+ z7vD3vRO`r*BS(%LIdbI4kt0Wr96562$dMyQjvP61 Date: Tue, 6 Feb 2024 21:14:12 +1100 Subject: [PATCH 8/8] 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+?kCOBl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?aDjM(Ud*E<4ThiS%)HzUaP#`B(PJ zvpkB=A1*Giw|(ZU9lF=(%m({SY>AJ1Pk!98;I$cFX>#ipg;iH}bGfbmsTbwnbF%7_ z$CGI_3Mt!f$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):