Skip to content

Commit

Permalink
Make test configuration work under Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
nmusatti committed Jun 8, 2024
1 parent 5baa9ca commit 470204f
Show file tree
Hide file tree
Showing 22 changed files with 250 additions and 66 deletions.
60 changes: 60 additions & 0 deletions bin/install_libs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# nxpy ------------------------------------------------------------------------

# Copyright Nicola Musatti 2024
# Use, modification, and distribution are subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# See https://github.com/nmusatti/nxpy. ---------------------------------------

r"""
Use pip to install all libraries.
"""
import os
import subprocess
import sys

from six import iteritems

SOURCES = {
'nxpy_abstract' : 'libs/abstract',
'nxpy_backup_file' : 'libs/backup_file',
'nxpy_command' : 'libs/command',
'nxpy_core' : 'libs/core',
'nxpy_file' : 'libs/file',
'nxpy_file_object' : 'libs/file_object',
'nxpy_maven' : 'libs/maven',
'nxpy_memo' : 'libs/memo',
'nxpy_nonblocking_subprocess' : 'libs/nonblocking_subprocess',
'nxpy_past' : 'libs/past',
'nxpy_path' : 'libs/path',
'nxpy_ply' : 'libs/ply',
'nxpy_sequence' : 'libs/sequence',
'nxpy_sort' : 'libs/sort',
'nxpy_svn' : 'libs/svn',
'nxpy_temp_file' : 'libs/temp_file',
'nxpy_test' : 'libs/test',
'nxpy_xml' : 'libs/xml',
}

def install_libs(sources, develop=False):
print("installing all libs in {} mode".format(
"development" if develop else "normal"))
wd = os.getcwd()
for k, v in iteritems(sources):
try:
os.chdir(os.path.join(wd, v))
if develop:
subprocess.call([sys.executable, '-m', 'pip', 'install', '-e', '.'])
else:
subprocess.call([sys.executable, '-m', 'pip', 'install', '.'])
except Exception as e:
print("Oops, something went wrong installing", k)
print(e)
finally:
os.chdir(wd)

if __name__ == '__main__':
develop = len(sys.argv) == 2 and sys.argv[1] in ( "-d", "--develop")
install_libs(SOURCES, develop)
11 changes: 10 additions & 1 deletion libs/abstract/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# nxpy_abstract ---------------------------------------------------------------

# Copyright Nicola Musatti 2024
# Use, modification, and distribution are subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# See https://github.com/nmusatti/nxpy/tree/master/libs/abstract. -------------

[build-system]
#requires = ["hatchling"]
#build-backend = "hatchling.build"
Expand All @@ -9,7 +18,7 @@ name = "nxpy-abstract"
dynamic = ["version"]
description = "Abstract class helpers"
readme = "README.rst"
license = "Boost Software License 1.0 (BSL-1.0)"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "[email protected]" },
]
Expand Down
17 changes: 14 additions & 3 deletions libs/backup_file/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# nxpy_backup_file ------------------------------------------------------------

# Copyright Nicola Musatti 2024
# Use, modification, and distribution are subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# See https://github.com/nmusatti/nxpy/tree/master/libs/backup_file. ----------

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
#requires = ["hatchling"]
#build-backend = "hatchling.build"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-backup-file"
dynamic = ["version"]
description = "A file-like object that keeps a copy of the file being edited"
readme = "README.rst"
license = "Boost Software License 1.0 (BSL-1.0)"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "[email protected]" },
]
Expand Down
17 changes: 14 additions & 3 deletions libs/command/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# nxpy_command ----------------------------------------------------------------

# Copyright Nicola Musatti 2024
# Use, modification, and distribution are subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# See https://github.com/nmusatti/nxpy/tree/master/libs/command. --------------

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
#requires = ["hatchling"]
#build-backend = "hatchling.build"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-command"
dynamic = ["version"]
description = "Wrap programs to call them as Python methods"
readme = "README.rst"
license = "Boost Software License 1.0 (BSL-1.0)"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "[email protected]" },
]
Expand Down
17 changes: 14 additions & 3 deletions libs/core/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# nxpy_core -------------------------------------------------------------------

# Copyright Nicola Musatti 2024
# Use, modification, and distribution are subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# See https://github.com/nmusatti/nxpy/tree/master/libs/core. -----------------

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
#requires = ["hatchling"]
#build-backend = "hatchling.build"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-core"
dynamic = ["version"]
description = "Infrastructure common to the Nxpy libraries"
readme = "README.rst"
license = "Boost Software License 1.0 (BSL-1.0)"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "[email protected]" },
]
Expand Down
17 changes: 14 additions & 3 deletions libs/file/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# nxpy_file -------------------------------------------------------------------

# Copyright Nicola Musatti 2024
# Use, modification, and distribution are subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# See https://github.com/nmusatti/nxpy/tree/master/libs/file. -----------------

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
#requires = ["hatchling"]
#build-backend = "hatchling.build"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-file"
dynamic = ["version"]
description = "File manipulation utilities"
readme = "README.rst"
license = "Boost Software License 1.0 (BSL-1.0)"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "[email protected]" },
]
Expand Down
17 changes: 14 additions & 3 deletions libs/file_object/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# nxpy_file_object ------------------------------------------------------------

# Copyright Nicola Musatti 2024
# Use, modification, and distribution are subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# See https://github.com/nmusatti/nxpy/tree/master/libs/file_object. ----------

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
#requires = ["hatchling"]
#build-backend = "hatchling.build"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-file-object"
dynamic = ["version"]
description = "Helper classes to implement file-like objects"
readme = "README.rst"
license = "Boost Software License 1.0 (BSL-1.0)"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "[email protected]" },
]
Expand Down
17 changes: 14 additions & 3 deletions libs/maven/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# nxpy_maven ------------------------------------------------------------------

# Copyright Nicola Musatti 2024
# Use, modification, and distribution are subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# See https://github.com/nmusatti/nxpy/tree/master/libs/maven. ----------------

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
#requires = ["hatchling"]
#build-backend = "hatchling.build"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-maven"
dynamic = ["version"]
description = "Utilities for the Maven build tool"
readme = "README.rst"
license = "Boost Software License 1.0 (BSL-1.0)"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "[email protected]" },
]
Expand Down
17 changes: 14 additions & 3 deletions libs/memo/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# nxpy_memo -------------------------------------------------------------------

# Copyright Nicola Musatti 2024
# Use, modification, and distribution are subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# See https://github.com/nmusatti/nxpy/tree/master/libs/memo. -----------------

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
#requires = ["hatchling"]
#build-backend = "hatchling.build"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-memo"
dynamic = ["version"]
description = "Base class to implement self-memoizing types"
readme = "README.rst"
license = "Boost Software License 1.0 (BSL-1.0)"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "[email protected]" },
]
Expand Down
17 changes: 14 additions & 3 deletions libs/nonblocking_subprocess/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# nxpy_nonblocking_subprocess -------------------------------------------------

# Copyright Nicola Musatti 2024
# Use, modification, and distribution are subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# See https://github.com/nmusatti/nxpy/tree/master/libs/nonblocking_subprocess.

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
#requires = ["hatchling"]
#build-backend = "hatchling.build"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-nonblocking-subprocess"
dynamic = ["version"]
description = "subprocess.Popen subclass using non-blocking I/O"
readme = "README.rst"
license = "Boost Software License 1.0 (BSL-1.0)"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "[email protected]" },
]
Expand Down
8 changes: 5 additions & 3 deletions libs/past/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
#requires = ["hatchling"]
#build-backend = "hatchling.build"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-past"
dynamic = ["version"]
description = "Python version based conditionals"
readme = "README.rst"
license = "Boost Software License 1.0 (BSL-1.0)"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "[email protected]" },
]
Expand Down
8 changes: 5 additions & 3 deletions libs/path/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
#requires = ["hatchling"]
#build-backend = "hatchling.build"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-path"
dynamic = ["version"]
description = "Wrap programs to call them as Python methods"
readme = "README.rst"
license = "Boost Software License 1.0 (BSL-1.0)"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "[email protected]" },
]
Expand Down
8 changes: 5 additions & 3 deletions libs/ply/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
#requires = ["hatchling"]
#build-backend = "hatchling.build"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-ply"
dynamic = ["version"]
description = "Utilities for the PLY parser generator"
readme = "README.rst"
license = "Boost Software License 1.0 (BSL-1.0)"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "[email protected]" },
]
Expand Down
8 changes: 5 additions & 3 deletions libs/sequence/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
#requires = ["hatchling"]
#build-backend = "hatchling.build"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-sequence"
dynamic = ["version"]
description = "Sequence related tools"
readme = "README.rst"
license = "Boost Software License 1.0 (BSL-1.0)"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "[email protected]" },
]
Expand Down
Loading

0 comments on commit 470204f

Please sign in to comment.