Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation remove #63

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
77 changes: 77 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[build-system]
requires = ["setuptools>=62.0", "setuptools-git-versioning<2"]
build-backend = "setuptools.build_meta"

[project]
name = "diffpy.srfit"
dynamic=['version']
authors = [
{ name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" },
]
maintainers = [
{ name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" },
]
description = "SrFit - Structure refinement from diffraction data"
keywords = "optimization constraints restraints structure refinement complex modeling"
readme = "README.rst"
requires-python = ">=3.10"
classifiers = [
# List of possible values at
# http://pypi.python.org/pypi?:action=list_classifiers
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: MacOS',
'Operating System :: POSIX',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Physics',
'Topic :: Software Development :: Libraries',
]

[project.urls]
Homepage = "https://github.com/diffpy/diffpy.srfit"
Issues = "https://github.com/diffpy/diffpy.srfit/issues"

[tool.setuptools-git-versioning]
enabled = true
template = "{tag}"
dev_template = "{tag}"
dirty_template = "{tag}"

[project.scripts]
srfit = "diffpy.srfit:main"

[tool.setuptools.packages.find]
where = ["src"] # list of folders that contain the packages (["."] by default)
include = ["diffpy*"] # package names should match these glob patterns (["*"] by default)
exclude = ["diffpy.srfit.tests*"] # exclude packages matching these glob patterns (empty by default)
namespaces = false # to disable scanning PEP 420 namespaces (true by default)

[tool.black]
line-length = 115
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist

# The following are specific to Black, you probably don't want those.
| blib2to3
| tests/data
)/
'''

7 changes: 4 additions & 3 deletions src/diffpy/srfit/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"""Unit tests for diffpy.srfit.
"""

import unittest
import logging
import unittest

# create logger instance for the tests subpackage
logging.basicConfig()
Expand All @@ -43,9 +43,9 @@ def testsuite(pattern=''):
import re
from os.path import dirname
from itertools import chain
from pkg_resources import resource_filename
from importlib.resources import files
loader = unittest.defaultTestLoader
thisdir = resource_filename(__name__, '')
thisdir = files(__name__) / ""
depth = __name__.count('.') + 1
topdir = thisdir
for i in range(depth):
Expand Down Expand Up @@ -82,4 +82,5 @@ def test():
return result



# End of file
5 changes: 3 additions & 2 deletions src/diffpy/srfit/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@

import os.path

from pkg_resources import resource_filename
from importlib.resources import files


# obtain version information from the version.cfg file
cp = dict(version='', date='', commit='', timestamp='0')
fcfg = resource_filename(__name__, 'version.cfg')
fcfg = files(__name__) / "version.cfg"
if not os.path.isfile(fcfg): # pragma: no cover
from warnings import warn
warn('Package metadata not found, execute "./setup.py egg_info".')
Expand All @@ -47,6 +47,7 @@
__git_commit__ = cp['commit']
__timestamp__ = int(cp['timestamp'])


# TODO remove deprecated __gitsha__ in version 3.1.
__gitsha__ = __git_commit__

Expand Down