Skip to content

Commit

Permalink
Removing tests from the actual package; various pytest improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterMeisrimelModelon committed Feb 15, 2024
1 parent 53a2dbf commit d133e9c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
- name: Build
run: python3 setup.py install --user --sundials-home=/usr --blas-home=/usr/lib/x86_64-linux-gnu/ --lapack-home=/usr/lib/x86_64-linux-gnu/ --superlu-home=/usr --extra-fortran-compile-flags="-fallow-argument-mismatch"
- name: Test
run: pytest --verbose tests/
run: pytest
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Improved examples with sparse jacobians by omitting the zeros in the jacobians.
* Upgraded to Cython >= 3.
* Removed deprecated build option "sundials_with_superlu", which is checked automatically.
* Removed tests from the actual assimulo package.

--- Assimulo-3.4.3 ---
* Improved compliance with newer scipy version by instead using corresponding numpy calls when more suitable.
Expand Down
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Installation is performed using the command:
'python setup.py install --sundials-home=/path/to/sundials --blas-home=/path/to/blas --lapack-home=/path/to/lapack'

Assimulo is then installed under Python dist-packages.
To test the installation, run "pytest tests/".
To test the installation, run "pytest" in the Assimulo directory.

For more information regarding Assimulo and the installation procedure,
please visit: http://www.jmodelica.org/assimulo
8 changes: 4 additions & 4 deletions doc/sphinx/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ the section troubleshooting see :ref:`instTrouble` should be consulted before in

.. note::

To test Assimulo, go into the tests folder and type::
To test Assimulo, go to the Assimulo directory and type::
pytest .
pytest
Which requires pytest.

Expand All @@ -88,9 +88,9 @@ After a successful installation, the package will be located in pythons dist-pac

.. note::

To test Assimulo, go into the tests folder and type::
To test Assimulo, go to the Assimulo directory and type::
pytest .
pytest
Which requires pytest.

Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ install_requires =
cython >= 3.0.7
pytest >= 7.4.4
matplotlib > 3

# pytest configuration
[tool:pytest]
addopts = -v
testpaths = "tests"
11 changes: 2 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,28 +202,23 @@ def _set_directories(self):
self.desSolvers = os.path.join(self.desSrc,"solvers")
self.desExamples = os.path.join(self.desSrc,"examples")
self.desMain = os.path.join(self.curdir,"build")
self.desTests = os.path.join(self.desSrc,"tests")
self.desTestsSolvers = os.path.join(self.desTests,"solvers")
self.desThirdParty=dict([(thp,os.path.join(self.curdir,self.build_assimulo_thirdparty,thp))
for thp in self.thirdparty_methods])
# filelists
# file lists
self.fileSrc = os.listdir("src")
self.fileLib = os.listdir(os.path.join("src","lib"))
self.fileSolvers = os.listdir(os.path.join("src","solvers"))
self.fileExamples= os.listdir("examples")
self.fileMain = ["setup.py","README.md","INSTALL","CHANGELOG","MANIFEST.in"]
self.fileMainIncludes = ["README.md","CHANGELOG", "LICENSE"]
self.fileTests = os.listdir("tests")
self.filelist_thirdparty=dict([(thp,os.listdir(os.path.join("thirdparty",thp)))
for thp in self.thirdparty_methods])
self.fileTestsSolvers = os.listdir(os.path.join("tests","solvers"))

def create_assimulo_dirs_and_populate(self):
self._set_directories()

for subdir in ["lib", "solvers", "examples"]:
self.create_dir(os.path.join(self.build_assimulo,subdir))
self.create_dir(os.path.join(self.build_assimulo, "tests", "solvers"))
for pck in self.thirdparty_methods:
self.create_dir(os.path.join(self.build_assimulo_thirdparty, pck))

Expand All @@ -233,8 +228,6 @@ def create_assimulo_dirs_and_populate(self):
self.copy_all_files(self.fileExamples, "examples", self.desExamples)
self.copy_all_files(self.fileMain, None, self.desMain)
self.copy_all_files(self.fileMainIncludes, None, self.desSrc)
self.copy_all_files(self.fileTests, "tests", self.desTests)
self.copy_all_files(self.fileTestsSolvers, os.path.join("tests","solvers"), self.desTestsSolvers)

for f in self.filelist_thirdparty.items():
logging.debug('Thirdparty method {} file {} copied'.format(f[0],f[1]))
Expand Down Expand Up @@ -724,7 +717,7 @@ def fortran_extensionlists(self):
platforms=PLATFORMS,
classifiers=CLASSIFIERS,
package_dir = {'assimulo':'assimulo'},
packages=['assimulo', 'assimulo.lib','assimulo.solvers','assimulo.examples','assimulo.tests','assimulo.tests.solvers'],
packages=['assimulo', 'assimulo.lib','assimulo.solvers','assimulo.examples'],
#cmdclass = {'build_ext': build_ext},
ext_modules = ext_list,
package_data={'assimulo': ['*.pxd', 'version.txt', 'CHANGELOG', 'README.md', 'LICENSE']+license_info+['examples'+os.sep+'kinsol_ors_matrix.mtx',
Expand Down

0 comments on commit d133e9c

Please sign in to comment.