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

Fixed the stuff to use setuptools better. #320

Open
wants to merge 1 commit into
base: master
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
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*.py]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
end_of_line = lf
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.cache/
*.egg-info/
*.pyc
/dist
/build
12 changes: 0 additions & 12 deletions dill/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,9 @@
# - https://github.com/uqfoundation/dill/blob/master/LICENSE

# get version numbers, license, and long description
try:
from .info import this_version as __version__
from .info import readme as __doc__, license as __license__
except ImportError:
msg = """First run 'python setup.py build' to build dill."""
raise ImportError(msg)

__author__ = 'Mike McKerns'

__doc__ = """
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The __init__.__doc__ needs to stay, as that is what is seen in the docs at http://dill.rtfd.io/.

""" + __doc__

__license__ = """
""" + __license__

from ._dill import dump, dumps, load, loads, dump_session, load_session, \
Pickler, Unpickler, register, copy, pickle, pickles, check, \
HIGHEST_PROTOCOL, DEFAULT_PROTOCOL, PicklingError, UnpicklingError, \
Expand Down
Empty file added dill/tools/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion scripts/get_objgraph → dill/tools/get_objgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
load_types(pickleable=True,unpickleable=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea. I have a few issues, however:

  • load_types with all objects being loaded I believe will incur a speed hit which is fairly unacceptable for dill in use in parallel computing.
  • I'm not sure I like the name dill.tools. I think I've used scripts elsewhere for similar conversions of scripts to functions.

from dill import objects

if __name__ == "__main__":
def get_objgraph():
import sys
if len(sys.argv) != 2:
print ("Please provide exactly one file or type name (e.g. 'IntType')")
Expand Down
2 changes: 1 addition & 1 deletion scripts/undill → dill/tools/undill.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
['hello', 'world']
"""

if __name__ == '__main__':
def undill():
import sys
import dill
for file in sys.argv[1:]:
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
requires = ["setuptools>=44", "wheel", "setuptools_scm[toml]>=3.4.3"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
52 changes: 48 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,48 @@
[egg_info]
tag_build = .dev0
#tag_svn_revision = yes
#tag_date = yes
[metadata]
name = dill
author = Mike McKerns
maintainer = Mike McKerns
license = BSD-3-Clause
license_file = LICENSE
description = serialize all of python
long_description = file: README.md
long_description_content_type = text/markdown
url = https://pypi.org/project/dill
homepage = https://github.com/uqfoundation/dill
download_url = https://github.com/uqfoundation/dill
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Programming Language :: Python :: 2
Programming Language :: Python :: 2.5
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.1
Programming Language :: Python :: 3.2
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Topic :: Scientific/Engineering
Topic :: Software Development
platforms = Linux, Windows, Mac

[options]
packages = dill, dill.tools
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had dill.tests as a module. While it might not be 100% desirable to include tests as a module, it at least was necessary for tests to run in some cases. Needs investigation.

zip_safe = False
python_requires = >=2.5, !=3.0.*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctypes requirement is missing. It's needed for certain non-standard platforms, I believe like google cloud, if I remember correctly.

Copy link
Author

@KOLANICH KOLANICH Jun 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't ctypes a part of python stdlib?

Copy link
Member

@mmckerns mmckerns Jun 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes... or more precisely... believe it or not... most of the time it is. The STL contents are not all the same on all platforms and distributions, and last I checked, it was one of a few libraries that isn't always shipped as part of the STL.

For example: bz2 and sqlite3 aren't installed on Ubuntu by default, and ctypes doesn't come installed by default with pypy or if using MacPorts.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and ctypes doesn't come installed by default with pypy or if using MacPorts.

I guess that in this case it should be installed using system package manager, like apt and brew, not pip.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't control how people install dill -- the fact is sometimes the STL is slightly different due to how and where it was installed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thue problem is not with dill, but with its native dependencies which are meant to be a part of python interpreter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. But, we have a practical problem here, about what to do about it.

setup_requires = setuptools>=44; wheel; setuptools_scm[toml]>=3.4.3

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two cfg are some nice modernization.

[options.extras_require]
readline = pyreadline>=1.7.1
graph = objgraph>=1.7.2

[options.entry_points]
console_scripts =
undill = dill.tools.undill:undill
get_objgraph = dill.tools.get_objgraph:get_objgraph
Loading