Skip to content

Commit

Permalink
Merge pull request #2 from nmusatti/migrate_to_pyproject_toml
Browse files Browse the repository at this point in the history
Migrate to pyproject toml
  • Loading branch information
nmusatti committed Jun 11, 2024
2 parents 97d4fac + dd78b55 commit a88bb60
Show file tree
Hide file tree
Showing 25 changed files with 1,045 additions and 165 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@ name: test

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
version:
- github: 2.7
tox: py27
cmd: python
- github: 3.6
tox: py36
cmd: python3
- github: 3.7
tox: py37
cmd: python3
Expand All @@ -29,13 +23,19 @@ jobs:
- github: "3.10"
tox: py310
cmd: python3
- github: "3.11"
tox: py311
cmd: python3
- github: "3.12"
tox: py312
cmd: python3
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version.github }}
- run: |
${{ matrix.version.cmd }} -m pip install --upgrade pip
${{ matrix.version.cmd }} -m pip install tox
- run: |
tox -e ${{ matrix.version.tox }}-mylinux
tox -e ${{ matrix.version.tox }}-lnx
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)
53 changes: 53 additions & 0 deletions libs/abstract/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-abstract"
dynamic = ["version"]
description = "Abstract class helpers"
readme = "README.rst"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "nicola.musatti@gmail.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Boost Software License 1.0 (BSL-1.0)",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Software Development :: Libraries",
]
dependencies = [
"six",
]

[project.urls]
Documentation = "https://nxpy.readthedocs.io/en/latest/abstract.html"
Homepage = "https://github.com/nmusatti/nxpy"
"Source Code" = "https://github.com/nmusatti/nxpy/tree/master/libs/abstract"

[tool.hatch.version]
path = "nxpy/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
"/nxpy",
]
56 changes: 56 additions & 0 deletions libs/backup_file/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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 = ["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.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "nicola.musatti@gmail.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Boost Software License 1.0 (BSL-1.0)",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Software Development :: Libraries",
]
dependencies = [
"nxpy_core",
"nxpy_file_object",
"nxpy_path",
"six",
]

[project.urls]
Documentation = "https://nxpy.readthedocs.io/en/latest/"
Homepage = "https://github.com/nmusatti/nxpy"
"Source Code" = "https://github.com/nmusatti/nxpy"

[tool.hatch.version]
path = "nxpy/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
"/nxpy",
]
56 changes: 56 additions & 0 deletions libs/command/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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 = ["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.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "nicola.musatti@gmail.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Boost Software License 1.0 (BSL-1.0)",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Software Development :: Libraries",
]
dependencies = [
"nxpy_core",
"nxpy_nonblocking_subprocess",
"nxpy_sequence",
"six",
]

[project.urls]
Documentation = "https://nxpy.readthedocs.io/en/latest/"
Homepage = "https://github.com/nmusatti/nxpy"
"Source Code" = "https://github.com/nmusatti/nxpy"

[tool.hatch.version]
path = "nxpy/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
"/nxpy",
]
51 changes: 51 additions & 0 deletions libs/core/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# 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 = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-core"
dynamic = ["version"]
description = "Infrastructure common to the Nxpy libraries"
readme = "README.rst"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "nicola.musatti@gmail.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Boost Software License 1.0 (BSL-1.0)",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Software Development :: Libraries",
]
dependencies = []

[project.urls]
Documentation = "https://nxpy.readthedocs.io/en/latest/core.html"
Homepage = "https://github.com/nmusatti/nxpy"
"Source Code" = "https://github.com/nmusatti/nxpy/tree/master/libs/core"

[tool.hatch.version]
path = "nxpy/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
"/nxpy",
]
54 changes: 54 additions & 0 deletions libs/file/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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 = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nxpy-file"
dynamic = ["version"]
description = "File manipulation utilities"
readme = "README.rst"
license.file = "LICENSE.txt"
authors = [
{ name = "Nicola Musatti", email = "nicola.musatti@gmail.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Boost Software License 1.0 (BSL-1.0)",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Software Development :: Libraries",
]
dependencies = [
"nxpy_past",
"six",
]

[project.urls]
Documentation = "https://nxpy.readthedocs.io/en/latest/"
Homepage = "https://github.com/nmusatti/nxpy"
"Source Code" = "https://github.com/nmusatti/nxpy"

[tool.hatch.version]
path = "nxpy/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
"/nxpy",
]
Loading

0 comments on commit a88bb60

Please sign in to comment.