Skip to content

Commit 376e794

Browse files
committed
improve packaging
- fix #83 - update metadata - use SPDX identifiers for license (and include license files, requires setuptools >= 77.0.0 instead of 40ish) - fixed classifier meta data for OS Windows (stray space): this failed PyPi upload - replace deprecated codes.open() with open() - include tests in package; define the pytest "online" tag also in conftest.py so that `pytest --pyargs MDAnalysisTests` runs without warnings about undefined "online" marker - avoid warning about MDAnalysis.descr package: include as data (include by looking for namespace packages as recommended in https://setuptools.pypa.io/en/latest/userguide/datafiles.html#subdirectory-for-data-files) - ensure that no stray files (eg __pycache__) from built project are included in package
1 parent e8598b1 commit 376e794

5 files changed

Lines changed: 17 additions & 15 deletions

File tree

MANIFEST.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
include README.md AUTHORS LICENSE CHANGELOG.md
1+
include README.md CHANGELOG.md
2+
graft MDAnalysisData
3+
global-exclude __pycache__ *.pyc *~

MDAnalysisData/descr/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

MDAnalysisData/tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# see also pyproject.toml pytest.markers
2+
def pytest_configure(config):
3+
config.addinivalue_line(
4+
"markers", "online: will fetch remote files (deselect with with '-m \"not online\"')",
5+
)

pyproject.toml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
[build-system]
22
requires = [
3-
"setuptools >= 40.9.0",
3+
"setuptools >= 77.0.0",
44
"versioningit",
55
]
66
build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "MDAnalysisData"
1010
description = "MDAnalysis example data"
11-
license = {file = "LICENSE" }
11+
license = "BSD-3-Clause"
12+
license-files = ["LICENSE", "AUTHORS"]
1213
authors = [
1314
{name = "Oliver Beckstein", email = "orbeckst@gmail.com"},
1415
]
@@ -19,10 +20,9 @@ classifiers = [
1920
"Development Status :: 4 - Beta",
2021
"Environment :: Console",
2122
"Intended Audience :: Science/Research",
22-
"License :: OSI Approved :: BSD License",
2323
"Operating System :: POSIX",
2424
"Operating System :: MacOS :: MacOS X",
25-
"Operating System :: Microsoft :: Windows ",
25+
"Operating System :: Microsoft :: Windows",
2626
"Programming Language :: Python",
2727
"Programming Language :: Python :: 3",
2828
"Programming Language :: Python :: 3.11",
@@ -59,17 +59,14 @@ documentation = "https://www.mdanalysis.org/MDAnalysisData"
5959

6060
[tool.setuptools]
6161
zip-safe = true
62-
include-package-data = true
6362

6463
[tool.setuptools.packages.find]
65-
namespaces = false
66-
include=["MDAnalysisData"]
64+
namespaces = true
65+
where = ["."]
6766
exclude=["docs"]
6867

6968
[tool.setuptools.package-data]
70-
MDAnalysisData = [
71-
"descr/*.rst",
72-
]
69+
"MDAnalysisData.descr" = ["*.rst"]
7370

7471
[tool.versioningit]
7572
default-version = "1+unknown"

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
Barebones setup.py for dynamic authors list generation.
33
"""
4-
import codecs
54
import os
65
import warnings
76

@@ -33,7 +32,7 @@ def dynamic_author_list():
3332
# MDAnalysisData.
3433

3534
authors = []
36-
with codecs.open(abspath('AUTHORS'), encoding='utf-8') as infile:
35+
with open(abspath('AUTHORS'), encoding='utf-8') as infile:
3736
# An author is a bullet point under the title "Chronological list of
3837
# authors". We first want move the cursor down to the title of
3938
# interest.
@@ -64,7 +63,7 @@ def dynamic_author_list():
6463

6564
# Write the authors.py file.
6665
out_path = abspath('MDAnalysisData/authors.py')
67-
with codecs.open(out_path, 'w', encoding='utf-8') as outfile:
66+
with open(out_path, 'w', encoding='utf-8') as outfile:
6867
# Write the header
6968
header = '''\
7069
#-*- coding:utf-8 -*-

0 commit comments

Comments
 (0)