Skip to content

Commit

Permalink
Enable sdist for linux platforms and bump to 2.0.1
Browse files Browse the repository at this point in the history
Linux wheels are apparently not currently supported by PyPI. This is understandable, as compiled code can be *that* platform-specific, but TkImg isn't, so if you're on Linux, I recommend using the wheels in the releases.
  • Loading branch information
RedFantom committed Jan 27, 2018
1 parent c9fdd1b commit e1d5c1d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ deploy:
provider: GitHub
auth_token:
secure: QimY++/91urL/oMJL/q2zYFqc1C7747HguEaIbPQovtC3zG8CK+TiCmFOCXy1D6e
artifact: dist/*.whl
artifact: /dist\\*.whl/
draft: false
prerelease: false
force_update: true
Expand Down
17 changes: 11 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ def read(fname):


if __name__ == '__main__':
# Set up TkImg library
prefix = sys.platform if sys.platform not in platforms else platforms[sys.platform]
arch = int(architecture()[0][:2])
current_dir = os.path.dirname(__file__)
tkimg_folder = os.path.join(current_dir, "tkimg", "{}{}".format(prefix, arch))
dest_dir = os.path.join(current_dir, "ttkthemes", "tkimg")
if "sdist" not in sys.argv[1]:
# Set up TkImg library for bdist or install
prefix = sys.platform if sys.platform not in platforms else platforms[sys.platform]
arch = int(architecture()[0][:2])
tkimg_folder = os.path.join(current_dir, "tkimg", "{}{}".format(prefix, arch))
dest_dir = os.path.join(current_dir, "ttkthemes", "tkimg")
else:
# Set up TkImg library for sdist
tkimg_folder = os.path.join(current_dir, "tkimg")
dest_dir = os.path.join(current_dir, "ttkthemes", "tkimg")
if os.path.exists(dest_dir):
rmtree(dest_dir)
copytree(tkimg_folder, dest_dir)
Expand All @@ -35,7 +40,7 @@ def read(fname):
name='ttkthemes',
packages=['ttkthemes'],
package_data={"ttkthemes": ["themes/*", "tkimg/*"]},
version='2.0.0',
version='2.0.1',
description='A group of themes for the ttk extensions of Tkinter with a Tkinter.Tk wrapper',
author='The ttkthemes authors',
author_email='[email protected]',
Expand Down
14 changes: 13 additions & 1 deletion ttkthemes/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
import sys
import os
from shutil import rmtree
from platform import architecture
from tempfile import gettempdir


platforms = {
"win32": "win",
"linux2": "linux"
}


def is_python_3():
"""Check interpreter version"""
return sys.version_info.major == 3
Expand Down Expand Up @@ -45,4 +52,9 @@ def get_tkimg_directory():
"""
Return an absolute path to the TkImg directory for current platform
"""
return os.path.join(os.path.dirname(__file__), "tkimg")
tkimg = os.path.join(os.path.dirname(__file__), "tkimg")
if not os.path.exists(os.path.join(tkimg, "pkgIndex.tcl")):
prefix = sys.platform if sys.platform not in platforms else platforms[sys.platform]
arch = architecture()[0]
tkimg = os.path.join(tkimg, "{}{}".format(prefix, arch))
return tkimg

0 comments on commit e1d5c1d

Please sign in to comment.