-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1063 from sbillinge/pyproject_toml
move installation to pyproject.toml
- Loading branch information
Showing
4 changed files
with
121 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
[build-system] | ||
requires = ["setuptools>=62.0", "setuptools-git-versioning<2"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "regolith" | ||
dynamic=['version'] | ||
authors = [ | ||
{ name="Simon J.L. Billinge group", email="[email protected]" }, | ||
{ name="Anthony Scopatz", email="[email protected]" }, | ||
] | ||
maintainers = [ | ||
{ name="Simon J.L. Billinge group", email="[email protected]" }, | ||
{ name="Anthony Scopatz", email="[email protected]" }, | ||
] | ||
description = "A research group content management system" | ||
keywords = ["content management system"] | ||
readme = "README.rst" | ||
requires-python = ">=3.10" | ||
classifiers = [ | ||
'Development Status :: 5 - Production/Stable', | ||
'Environment :: Console', | ||
'Intended Audience :: Developers', | ||
'Intended Audience :: Science/Research', | ||
'License :: CC0', | ||
'Operating System :: MacOS :: MacOS X', | ||
'Operating System :: Microsoft :: Windows', | ||
'Operating System :: POSIX', | ||
'Operating System :: Unix', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11', | ||
'Programming Language :: Python :: 3.12', | ||
'Topic :: Scientific/Engineering :: Physics', | ||
] | ||
|
||
[tool.setuptools] | ||
script-files = ["scripts/regolith", "scripts/helper_gui", "scripts/helper_connect", "scripts/profile_regolith", "scripts/profile_helper_gui"] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/regro/regolith/" | ||
Issues = "https://github.com/regro/regolith/issues" | ||
|
||
[tool.setuptools-git-versioning] | ||
enabled = true | ||
template = "{tag}" | ||
dev_template = "{tag}" | ||
dirty_template = "{tag}" | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["."] # list of folders that contain the packages (["."] by default) | ||
include = ["regolith*"] # package names should match these glob patterns (["*"] by default) | ||
exclude = [] # exclude packages matching these glob patterns (empty by default) | ||
namespaces = true # to disable scanning PEP 420 namespaces (true by default) | ||
|
||
[tool.setuptools.package-data] | ||
regolith = ["templates/*", | ||
"static/*.*", | ||
"static/img/*.*", | ||
"*.xsh", | ||
"*.json" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env python | ||
############################################################################## | ||
# | ||
# regolith by DANSE Diffraction group | ||
# Simon J. L. Billinge | ||
# (c) 2011 The Trustees of Columbia University | ||
# in the City of New York. All rights reserved. | ||
# | ||
# File coded by: Pavol Juhas | ||
# | ||
# See AUTHORS.txt for a list of people who contributed. | ||
# See LICENSE_DANSE.txt for license information. | ||
# | ||
############################################################################## | ||
|
||
""" | ||
Definition of __version__, __date__, __timestamp__, __git_commit__. | ||
Notes | ||
----- | ||
Variable `__gitsha__` is deprecated as of version 3.0. | ||
Use `__git_commit__` instead. | ||
""" | ||
|
||
__all__ = ['__date__', '__git_commit__', '__timestamp__', '__version__'] | ||
|
||
import os.path | ||
|
||
from importlib.resources import files, as_file | ||
|
||
|
||
# obtain version information from the version.cfg file | ||
cp = dict(version='', date='', commit='', timestamp='0') | ||
if __package__ is not None: | ||
ref = files(__package__) / 'version.cfg' | ||
with as_file(ref) as fcfg: | ||
if not os.path.isfile(fcfg): # pragma: no cover | ||
from warnings import warn | ||
warn('Package metadata not found.') | ||
fcfg = os.devnull | ||
with open(fcfg) as fp: | ||
kwords = [[w.strip() for w in line.split(' = ', 1)] | ||
for line in fp if line[:1].isalpha() and ' = ' in line] | ||
assert all(w[0] in cp for w in kwords), "received unrecognized keyword" | ||
cp.update(kwords) | ||
del kwords | ||
|
||
__version__ = cp['version'] | ||
__date__ = cp['date'] | ||
__git_commit__ = cp['commit'] | ||
__timestamp__ = int(cp['timestamp']) | ||
|
||
# TODO remove deprecated __gitsha__ in version 3.1. | ||
__gitsha__ = __git_commit__ | ||
|
||
del cp | ||
|
||
# End of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,29 +29,9 @@ def main(): | |
with open(os.path.join(os.path.dirname(__file__), "README.rst"), "r") as f: | ||
readme = f.read() | ||
skw = dict( | ||
name="regolith", | ||
description="A research group content management system", | ||
long_description=readme, | ||
license="CC0", | ||
version='0.8.2', | ||
author="Anthony Scopatz", | ||
maintainer="Anthony Scopatz", | ||
author_email="[email protected]", | ||
url="https://github.com/scopatz/regolith", | ||
platforms="Cross Platform", | ||
python_requires='>=3.8', | ||
classifiers=["Programming Language :: Python :: 3"], | ||
packages=["regolith", "regolith.builders", "regolith.helpers"], | ||
package_dir={"regolith": "regolith"}, | ||
package_data={ | ||
"regolith": [ | ||
"templates/*", | ||
"static/*.*", | ||
"static/img/*.*", | ||
"*.xsh", | ||
"*.json" | ||
] | ||
}, | ||
scripts=["scripts/regolith"], | ||
zip_safe=False, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters