From 6b6d028a886e35ed74686c76980246e004822420 Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Sat, 29 Jun 2024 08:48:49 +0530 Subject: [PATCH 1/5] Allow the tests to run even from an installation. Currently if you run `pytest --pyargs automan` outside the source directory it will fail since once of the tests assumes that it is being run from the automan source directory. This is now skipped if there is no setup.py in the current directory. --- automan/tests/test_cluster_manager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/automan/tests/test_cluster_manager.py b/automan/tests/test_cluster_manager.py index a623b18..6b0ee01 100644 --- a/automan/tests/test_cluster_manager.py +++ b/automan/tests/test_cluster_manager.py @@ -141,6 +141,11 @@ def test_cli(self, mock_update, mock_add_worker): sys.platform.startswith('win'), 'Test requires Python 3.x and a non-Windows system.') def test_remote_bootstrap_and_sync(self): + if not os.path.exists('setup.py'): + raise unittest.SkipTest( + 'This test requires to be run from the automan source directory.' + ) + # Given cm = MyClusterManager(exclude_paths=['outputs/'], testing=True) cm.BOOTSTRAP = cm.BOOTSTRAP.replace('ROOT', self.cwd) From b58472924d848a537e3fdd4fb4d919a17a93b933 Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Sat, 29 Jun 2024 08:56:36 +0530 Subject: [PATCH 2/5] Fix tests by updating Python versions. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index acde84c..4f52f36 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: [3.7, 3.8] + python-version: [3.8, 3.12] runs-on: ${{ matrix.os }} From 87d08d49f24629e8d2d1622c228642c20fcb9d52 Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Sat, 29 Jun 2024 09:02:40 +0530 Subject: [PATCH 3/5] Add pyproject.toml. --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f915769 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[build-system] +requires = [ + "wheel>=0.29.0", + "setuptools>=42.0.0" +] \ No newline at end of file From 47f41ab65985b356e6de3df86eff76cafdc9a648 Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Sat, 29 Jun 2024 09:06:52 +0530 Subject: [PATCH 4/5] Try and fix setup/testing for latest Python 3.12. --- .github/workflows/tests.yml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4f52f36..f884145 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install pytest coverage - python setup.py develop + python -m pip install -v . - name: Run tests run: | coverage erase diff --git a/setup.py b/setup.py index 55f7eb4..ab21f49 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ def get_version(): return data.get('__version__') -install_requires = ['psutil', 'execnet'] +install_requires = ['psutil', 'execnet', 'setuptools'] tests_require = ['pytest'] if sys.version_info.major < 3: tests_require.append('mock') From 568bf7f31aaa3cdf7458111ceee86d36c1254445 Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Sat, 29 Jun 2024 09:10:37 +0530 Subject: [PATCH 5/5] Add the toml file to the MANIFEST. --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index d157481..fe4033a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -include MANIFEST.in *.py *.rst *.txt *.yml +include MANIFEST.in *.py *.rst *.txt *.yml *.toml recursive-include docs *.* recursive-include examples *.py *.yml *.txt *.md recursive-exclude examples/tutorial/.automan *.*