diff --git a/Makefile b/Makefile index 3e8533b..11b1202 100644 --- a/Makefile +++ b/Makefile @@ -23,8 +23,6 @@ uninstall: develop-install: develop-uninstall $(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) @@ -32,7 +30,7 @@ help: ## Show this help. @grep '##' Makefile| sed -e '/@/d' | sed -r 's,(.*?:).*##(.*),\1\2,g' 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/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ec02335 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,45 @@ +[build-system] +requires = ["setuptools>=44"] +build-backend = "setuptools.build_meta" + +[project] +name = "imaids" +authors = [{ name = "lnls-ima" } ] +maintainers = [ + {name = "Gabriel Rezende de Ascenção", email = "gabriel.ascencao@lnls.br"}, + {name = "Lucas Francisco"}, +] +description = "Insertion Devices Package" +readme = "README.md" +dynamic = ["version", "dependencies"] +requires-python = ">=3.6" +classifiers = [ + "Intended Audience :: Science/Research", + "Programming Language :: Python", + "Topic :: Scientific/Engineering", +] +keywords = ["SIRIUS", "python", "Accelerator Physics", "Insertion Devices"] + +license = "MIT" +license-files= [ "LICENSE", ] + +[project.urls] +Homepage = "https://github.com/lnls-ima/insertion-devices" +Download = "https://github.com/lnls-ima/insertion-devices" +Repository = "https://github.com/lnls-ima/insertion-devices.git" +Issues = "https://github.com/lnls-ima/insertion-devices/issues" + +[project.optional-dependencies] +tests = ["nose"] + +# --- Setuptools specific configurations --- +[tool.setuptools] +packages = ["imaids"] +include-package-data = true + +[tool.setuptools.dynamic] +version = { file = "VERSION" } +dependencies = { file = "requirements.txt" } + +[tool.setuptools.package-data] +imaids = ["VERSION", "presets/*"] diff --git a/setup.py b/setup.py index 6e0c37d..b2037be 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,13 @@ """Setup module.""" +import pathlib + from setuptools import setup -import pkg_resources def get_abs_path(relative): - """Get absolute path of file.""" - return pkg_resources.resource_filename(__name__, relative) + """.""" + return str(pathlib.Path(__file__).parent / relative) with open(get_abs_path("README.md"), "r") as _f: