Switch to pyprojetc.toml

The packaging uses now the modern pyproject.toml and setup.cfg files.
The setup.py is deprecated.
This commit is contained in:
Sylvain Tricot 2022-10-27 14:45:38 +02:00
parent 6f254e688e
commit d1e52eae86
7 changed files with 68 additions and 106 deletions

View File

@ -11,19 +11,20 @@ pybinding:
venv: venv:
ifeq ($(NO_VENV),0) ifeq ($(NO_VENV),0)
@virtualenv --python=$(PYTHON_EXE) --prompt="(msspec-$(VERSION)) " $(VENV_PATH) @virtualenv --python=$(PYTHON_EXE) --prompt="(msspec-$(VERSION)) " $(VENV_PATH)
$(INSIDE_VENV) \ $(INSIDE_VENV) python -m ensurepip --upgrade
wget https://bootstrap.pypa.io/get-pip.py && \
python get-pip.py && \
pip install --upgrade setuptools && \
pip install -r src/pip.freeze && \
rm -f get-pip.py
endif endif
# wget https://bootstrap.pypa.io/get-pip.py && \
# python get-pip.py && \
# rm -f get-pip.py
# pip install --upgrade setuptools && \
# pip install -r src/pip.freeze && \
install: venv pybinding wx install: venv pybinding wx
@+$(INSIDE_VENV) $(MAKE) -C src sdist @+$(INSIDE_VENV) $(MAKE) -C src sdist
@+$(INSIDE_VENV) $(MAKE) -C src frontend @+$(INSIDE_VENV) $(MAKE) -C src frontend
@+$(INSIDE_VENV) pip install src/dist/msspec-$(VERSION).tar.gz @+$(INSIDE_VENV) pip install src/dist/msspec-$(VERSION)*.whl
@echo "Do not forget to check that $(INSTALL_PREFIX)/bin is set in your \$$PATH" @echo "Do not forget to check that $(INSTALL_PREFIX)/bin is set in your \$$PATH"

View File

@ -1,6 +0,0 @@
recursive-include msspec *.so
recursive-include . SConstruct
include setup_requirements.txt
include requirements.txt
include pip.freeze
include VERSION

View File

@ -11,14 +11,14 @@ frontend: $(INSTALL_PREFIX)/bin/msspec
dist/msspec-$(VERSION).tar.gz: VERSION dist/msspec-$(VERSION).tar.gz: VERSION
@echo "Creating Python source distribution..." @echo "Creating Python source distribution..."
@$(PYTHON_EXE) setup.py sdist @+$(INSIDE_VENV) pip install build
@+$(INSIDE_VENV) $(PYTHON_EXE) -m build
$(INSTALL_PREFIX)/bin/msspec: msspec.sh.template VERSION $(INSTALL_PREFIX)/bin/msspec: msspec.sh.template VERSION
@echo "Installing frontend command..." @echo "Installing frontend command..."
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
@cat $< | sed -e 's/__VERSION__/$(VERSION)/' -e 's#__VENV_PATH__#$(VENV_PATH)#' > $@ @cat $< | sed -e 's#__VENV_PATH__#$(VENV_PATH)#' > $@
#@cat $< | sed 's/__VERSION__/$(VERSION)/' > $@
@chmod 755 $@ @chmod 755 $@

View File

@ -1,12 +0,0 @@
ase
h5py
ipython
lxml
matplotlib
numpy
Pint
pandas
pycairo
scipy
setuptools-scm
terminaltables

3
src/pyproject.toml Normal file
View File

@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

54
src/setup.cfg Normal file
View File

@ -0,0 +1,54 @@
[metadata]
name = msspec
version = attr: msspec.version.__version__
author = Didier Sébilleau, Sylvain Tricot
author_email = sylvain.tricot@univ-rennes1.fr
url = https://msspec.cnrs.fr
description = A multiple scattering package for sepectroscopies using electrons to probe materials
long_description = MsSpec is a Fortran package to compute the
cross-section of several spectroscopies involving one (or more)
electron(s) as the probe. This package provides a python interface to
control all the steps of the calculation.
Available spectroscopies:
* Photoelectron diffraction
* Auger electron diffraction
* Low energy electron diffraction
* X-Ray absorption spectroscopy
* Auger Photoelectron coincidence spectroscopy
* Computation of the spectral radius""",
keywords = spectroscopy atom electron photon multiple scattering
license = GPL
classifiers =
Development Status :: 3 - Alpha
Environment :: Console
Intended Audience :: Science/Research
License :: OSI Approved :: GNU General Public License (GPL)
Natural Language :: English
Operating System :: Microsoft :: Windows :: Windows 10
Operating System :: POSIX :: Linux
Operating System :: MacOS :: MacOS X
Programming Language :: Fortran
Programming Language :: Python :: 3 :: Only
Topic :: Scientific/Engineering :: Physics
[options]
packages = find:
zip_safe = False
install_requires =
setuptools_scm
ase
h5py
ipython
lxml
matplotlib
numpy
Pint
pandas
pycairo
scipy
terminaltables
[options.package_data]
msspec.phagen.fortran = *.so
msspec.spec.fortran = *.so

View File

@ -1,78 +0,0 @@
#!/usr/bin/env python
#
# Copyright © 2016-2020 - Rennes Physics Institute
#
# This file is part of msspec.
#
# msspec is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# msspec is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this msspec. If not, see <http://www.gnu.org/licenses/>.
#
# Source file : src/setup.py
# Last modified: mar. 07 avril 2020 17:01:42
# Committed by : "Sylvain Tricot <sylvain.tricot@univ-rennes1.fr>"
import sys
sys.path.insert(0, "msspec")
from setuptools import setup, find_packages
from version import __version__
with open('pip.freeze', 'r') as fd:
REQUIREMENTS = fd.read().strip().split('\n')
if __name__ == "__main__":
setup(name='msspec',
version=__version__,
include_package_data=True,
packages=find_packages(include='msspec.*'),
#setup_requires=SETUP_REQUIREMENTS,
install_requires=REQUIREMENTS,
author='Didier Sébilleau, Sylvain Tricot',
author_email='sylvain.tricot@univ-rennes1.fr',
maintainer='Sylvain Tricot',
maintainer_email='sylvain.tricot@univ-rennes1.fr',
url='https://msspec.cnrs.fr',
description=('A multiple scattering package for sepectroscopies '
'using electrons to probe materials'),
long_description="""MsSpec is a Fortran package to compute the
cross-section of several spectroscopies involving one (or more)
electron(s) as the probe. This package provides a python interface to
control all the steps of the calculation.
Available spectroscopies:
* Photoelectron diffraction
* Auger electron diffraction
* Low energy electron diffraction
* X-Ray absorption spectroscopy
* Auger Photoelectron coincidence spectroscopy
* Computation of the spectral radius""",
download_url='https://msspec.cnrs.fr/downloads.html',
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Natural Language :: English',
'Operating System :: Microsoft :: Windows :: Windows 10',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS :: MacOS X',
'Programming Language :: Fortran',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Scientific/Engineering :: Physics',
],
keywords='spectroscopy atom electron photon multiple scattering',
license='GPL',
#entry_points={
# 'console_scripts': ['msspec=msspec.cli:main']}
)