From 2abcc8be9c776c0e7cd1c8e44da9353d3b8c6331 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 14:57:53 -0400 Subject: [PATCH 1/4] Remove gitarchive and attributes --- .gitarchive.cfg | 5 ----- .gitattributes | 7 ------- 2 files changed, 12 deletions(-) delete mode 100644 .gitarchive.cfg delete mode 100644 .gitattributes diff --git a/.gitarchive.cfg b/.gitarchive.cfg deleted file mode 100644 index 95e1448c..00000000 --- a/.gitarchive.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[DEFAULT] -commit = $Format:%H$ -date = $Format:%ci$ -timestamp = $Format:%ct$ -refnames = $Format:%D$ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 9d58a8cd..00000000 --- a/.gitattributes +++ /dev/null @@ -1,7 +0,0 @@ -/.gitattributes export-ignore -/.gitignore export-ignore -/.travis.yml export-ignore -/conda-recipe/ export-ignore -/devutils export-ignore -.gitarchive.cfg export-subst -*.bat text eol=crlf From dda5025d837c1e7b79b9e4556db89e769deaa538 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 14:58:20 -0400 Subject: [PATCH 2/4] Standarlize manifest,proproject to current cookiecutter --- MANIFEST.in | 40 ++++++++++++---------------------------- pyproject.toml | 7 +++++-- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 9902cd57..0990402a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,28 +1,12 @@ -recursive-include src/diffpy * -recursive-exclude src/diffpy *.py[co] *.so -recursive-include docs *.rst conf.py Makefile make.bat - -recursive-include src/extensions/libpdffit2 *.[ch]* -recursive-include src/extensions/pdffit2module *.[ch]* -recursive-include src/examples * -include AUTHORS.rst -include diffpy.pdffit2/version.py -include LICENSE.rst -include README.rst -include requirements/ -prune src/extensions/libpdffit2/tests -global-exclude .gitattributes .gitignore .gitarchive.cfg -global-exclude .DS_Store -recursive-exclude * __pycache__ -recursive-exclude * *.py[co] - -# If including data files in the package, add them like: -# include path/to/data_file - -# Avoid user content in setup.cfg to make distribution reproducible. -exclude setup.cfg - -# Exclude git-tracked files spuriously added by setuptools_scm -exclude .coveragerc -prune devutils -prune doc +graft src +graft tests +graft requirements + +include AUTHORS.rst LICENSE*.rst README.rst + +# Exclude all bytecode files and __pycache__ directories +global-exclude *.py[cod] # Exclude all .pyc, .pyo, and .pyd files. +global-exclude .DS_Store # Exclude Mac filesystem artifacts. +global-exclude __pycache__ # Exclude Python cache directories. +global-exclude .git* # Exclude git files and directories. +global-exclude .idea # Exclude PyCharm project settings. \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6945ff83..0ee80217 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["setuptools>=62.0", "setuptools-git-versioning<2"] +requires = ["setuptools>=62.0", "setuptools-git-versioning>=2.0"] build-backend = "setuptools.build_meta" [project] name = "diffpy.pdffit2" -dynamic=['version'] +dynamic=['version', 'dependencies'] authors = [ { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" }, ] @@ -48,6 +48,9 @@ include = ["*"] # package names should match these glob patterns (["*"] by defa exclude = ["diffpy.pdffit2.tests*"] # exclude packages matching these glob patterns (empty by default) namespaces = false # to disable scanning PEP 420 namespaces (true by default) +[tool.setuptools.dynamic] +dependencies = {file = ["requirements/run.txt"]} + [tool.black] line-length = 115 include = '\.pyi?$' From 6c0b5e38fa25f1ea50b44a91f46f144e78c25a1d Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 14:58:27 -0400 Subject: [PATCH 3/4] Remove devutils --- devutils/makesdist | 60 ---------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100755 devutils/makesdist diff --git a/devutils/makesdist b/devutils/makesdist deleted file mode 100755 index dccfaa99..00000000 --- a/devutils/makesdist +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python - -"""Create source distribution tar.gz archive, where each file belongs -to a root user and modification time is set to the git commit time. -""" - -import glob -import gzip -import os -import subprocess -import sys -import tarfile - -from setup import FALLBACK_VERSION, versiondata - -BASEDIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) -sys.path.insert(0, BASEDIR) - -timestamp = versiondata.getint("DEFAULT", "timestamp") - -vfb = versiondata.get("DEFAULT", "version").split(".post")[0] + ".post0" -emsg = "Invalid FALLBACK_VERSION. Expected %r got %r." -assert vfb == FALLBACK_VERSION, emsg % (vfb, FALLBACK_VERSION) - - -def inform(s): - sys.stdout.write(s) - sys.stdout.flush() - return - - -inform('Run "setup.py sdist --formats=tar" ') -cmd_sdist = [sys.executable] + "setup.py sdist --formats=tar".split() -ec = subprocess.call(cmd_sdist, cwd=BASEDIR, stdout=open(os.devnull, "w")) -if ec: - sys.exit(ec) -inform("[done]\n") - -tarname = max(glob.glob(BASEDIR + "/dist/*.tar"), key=os.path.getmtime) - -tfin = tarfile.open(tarname) -fpout = gzip.GzipFile(tarname + ".gz", "w", mtime=0) -tfout = tarfile.open(fileobj=fpout, mode="w") - - -def fixtarinfo(tinfo): - tinfo.uid = tinfo.gid = 0 - tinfo.uname = tinfo.gname = "root" - tinfo.mtime = timestamp - tinfo.mode &= ~0o022 - return tinfo - - -inform("Filter %s --> %s.gz " % (2 * (os.path.basename(tarname),))) -for ti in tfin: - tfout.addfile(fixtarinfo(ti), tfin.extractfile(ti)) - -tfin.close() -os.remove(tarname) -inform("[done]\n") From c0ed31bc271dfd9cfa4ab44681cc3c2b39bc78a5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 22 Sep 2024 18:59:21 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit hooks --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 0990402a..f1a78eec 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,4 +9,4 @@ global-exclude *.py[cod] # Exclude all .pyc, .pyo, and .pyd files. global-exclude .DS_Store # Exclude Mac filesystem artifacts. global-exclude __pycache__ # Exclude Python cache directories. global-exclude .git* # Exclude git files and directories. -global-exclude .idea # Exclude PyCharm project settings. \ No newline at end of file +global-exclude .idea # Exclude PyCharm project settings.