diff --git a/.github/workflows/pypi-siriuspy.yml b/.github/workflows/pypi-siriuspy.yml index 19ccac017..bce86285f 100644 --- a/.github/workflows/pypi-siriuspy.yml +++ b/.github/workflows/pypi-siriuspy.yml @@ -9,15 +9,15 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 with: python-version: "3.x" - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install setuptools wheel twine build - name: Build and publish env: @@ -26,6 +26,6 @@ jobs: run: | git describe --tags | sed -e 's/^v//g' > VERSION cd siriuspy - python setup.py sdist bdist_wheel + python -m build twine upload dist/* cd .. diff --git a/.github/workflows/test-siriuspy.yml b/.github/workflows/test-siriuspy.yml index 5aa0cf06b..3453d7078 100644 --- a/.github/workflows/test-siriuspy.yml +++ b/.github/workflows/test-siriuspy.yml @@ -4,15 +4,16 @@ on: [push] jobs: build: - runs-on: ubuntu-22.04 + runs-on: ${{matrix.os}} strategy: matrix: python-version: [3.9, 3.11] + os: [ubuntu-22.04, ubuntu-24.04] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/siriuspy/Makefile b/siriuspy/Makefile index 308839d4d..35fbceacf 100644 --- a/siriuspy/Makefile +++ b/siriuspy/Makefile @@ -7,19 +7,15 @@ ifeq ($(CONDA_PREFIX),) endif install: uninstall - $(PREFIX) $(PIP) install --no-use-pep517 --no-deps ./ -# $(PREFIX) $(PIP) install --no-deps ./ + $(PREFIX) $(PIP) install --no-deps ./ $(PREFIX) git clean -fdX uninstall: $(PREFIX) $(PIP) uninstall -y $(PACKAGE) develop-install: develop-uninstall - $(PIP) install --no-use-pep517 --no-deps -e ./ -# $(PIP) install --no-deps -e ./ + $(PIP) install --no-deps -e ./ -# known issue: It will fail to uninstall scripts -# if they were installed in develop mode develop-uninstall: $(PIP) uninstall -y $(PACKAGE) @@ -27,7 +23,7 @@ test: pytest tests/ dist: ## Build setuptools dist - python setup.py sdist bdist_wheel + python -m build distupload: ## Upload package dist to PyPi python -m twine upload --verbose dist/* diff --git a/siriuspy/pyproject.toml b/siriuspy/pyproject.toml index 86ee6c670..36352e5af 100644 --- a/siriuspy/pyproject.toml +++ b/siriuspy/pyproject.toml @@ -1,57 +1,48 @@ -# [build-system] -# requires = ["setuptools >= 61.0"] -# build-backend = "setuptools.build_meta" +[build-system] +requires = ["setuptools>=44"] +build-backend = "setuptools.build_meta" -# [project] -# name = "siriuspy" -# version = "2.85.0" -# dependencies = [ -# "aiohttp>=3.7.4", -# "bottleneck>=1.3.2", -# "mathphys", -# "numpy>=1.18", -# "pyepics>=3.4.0", -# "python-dateutil>=2.8.1", -# "requests>=2.22.0", -# "six>=1.13.0", -# "pyyaml", -# ] -# requires-python = ">=3.6" -# authors = [ -# {name = "lnls-sirius"}, -# ] -# maintainers = [ -# {name = "Ana Oliveira", email = "ana.clara@lnls.br"}, -# {name = "Ximenes Resende", email = "xresende@gmail.com"}, -# {name = "Fernando H. de Sá", email = "fernandohds564@gmail.com"}, -# {name = "Murilo Barbosa Alves", email= "murilo.alves@lnls.br"} -# ] -# description = "Development packages for SIRIUS" -# readme = "README.md" -# license = {file = "LICENSE.txt"} -# keywords = ["SIRIUS", "python", "EPICS"] -# classifiers = [ -# "Intended Audience :: Science/Research", -# "Programming Language :: Python", -# "Topic :: Scientific/Engineering", -# ] +[project] +name = "siriuspy" +authors = [{ name = "lnls-sirius" } ] +maintainers = [ + {name = "Ana Oliveira", email = "ana.clara@lnls.br"}, + {name = "Ximenes Resende", email = "xresende@gmail.com"}, + {name = "Fernando H. de Sá", email = "fernandohds564@gmail.com"}, + {name = "Murilo Barbosa Alves", email= "alvesb.murilo@gmail.com"} +] +description = "Development packages for Sirius" +readme = "README.md" +dynamic = ["version", "dependencies"] +requires-python = ">=3.6" +classifiers = [ + "Intended Audience :: Science/Research", + "Programming Language :: Python", + "Topic :: Scientific/Engineering", +] +keywords = ["SIRIUS", "python", "EPICS"] -# [project.urls] -# # Homepage = "" -# # Documentation = "" -# Repository = "https://github.com/lnls-sirius/dev-packages" -# "Bug Tracker" = "https://github.com/lnls-sirius/dev-packages/issues" -# # Changelog = "" +license = "GPL-3.0" +license-files= [ "LICENSE", ] -# # [project.optional-dependencies] -# # gui = [] -# # cli = [] +[project.urls] +Homepage = "https://github.com/lnls-sirius/dev-packages" +Download = "https://github.com/lnls-sirius/dev-packages" +Repository = "https://github.com/lnls-sirius/dev-packages.git" +Issues = "https://github.com/lnls-sirius/dev-packages/issues" -# # [project.scripts] +# --- Setuptools specific configurations --- +[tool.setuptools] +include-package-data = true -# # [project.gui-scripts] +[tool.setuptools.dynamic] +version = { file = "VERSION" } +dependencies = { file = "requirements.txt" } +[tool.setuptools.package-data] +siriuspy = ["VERSION"] +# --- linter and formatter configurations --- [tool.ruff] select = [ "W", "E", "A", "B", "C90", "D", "I002", "N", "F", "G", "ARG", "S", "NPY"] diff --git a/siriuspy/setup.py b/siriuspy/setup.py index f39f30c0d..0c7c8439b 100755 --- a/siriuspy/setup.py +++ b/siriuspy/setup.py @@ -2,12 +2,14 @@ """Siriuspy setup script.""" -import pkg_resources +import pathlib + from setuptools import find_packages, setup def get_abs_path(relative): - return pkg_resources.resource_filename(__name__, relative) + """.""" + return str(pathlib.Path(__file__).parent / relative) with open(get_abs_path("README.md"), "r") as _f: