Skip to content

Commit

Permalink
Merge pull request #35 from pypr/fix-tests-on-install
Browse files Browse the repository at this point in the history
Allow the tests to run even from an installation.
  • Loading branch information
prabhuramachandran authored Jun 29, 2024
2 parents 96fbe5b + 568bf7f commit e97a4fd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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 *.*
Expand Down
5 changes: 5 additions & 0 deletions automan/tests/test_cluster_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
requires = [
"wheel>=0.29.0",
"setuptools>=42.0.0"
]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit e97a4fd

Please sign in to comment.