Skip to content

Commit

Permalink
Replace python-versioneer with setuptools-scm
Browse files Browse the repository at this point in the history
Use setuptools-scm instead of python-versioneer to derive the current
version number from git tags. This is more up-to-date than
python-versioneer and seems to be well established in the Python
ecosystem.

This will fix python-versioneer from creating nondeterministic tarballs
when git-archive or GitHub's archive download feature is used. On the
other hand, those tarballs will no longer contain necessary version
information required for packaging!

If you're creating a custom package of Protontricks using an automated
process, you *WILL* now need to use PyPI tarballs or clone the
repository properly. The PyPI tarball approach is recommended by Arch
Linux's Python package guidelines.

Fixes #44.
  • Loading branch information
Matoking committed Jan 12, 2020
1 parent b10b79f commit 02a668e
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 2,363 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Created by https://www.gitignore.io/api/python,virtualenv

# Don't track setuptools-scm generated _version.py
src/protontricks/_version.py

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
include versioneer.py
include LICENSE
include src/protontricks/_version.py
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pytest>=3.6
pytest-cov
setuptools-scm
7 changes: 0 additions & 7 deletions setup.cfg

This file was deleted.

13 changes: 5 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from setuptools import setup

import versioneer


DESCRIPTION = (
"A simple wrapper for running Winetricks commands for Proton-enabled "
Expand All @@ -18,7 +16,9 @@

setup(
name="protontricks",
version=versioneer.get_version(),
use_scm_version={
"write_to": "src/protontricks/_version.py"
},
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
author=AUTHOR,
Expand All @@ -28,9 +28,8 @@
packages=["protontricks"],
package_data={"": ["LICENSE"]},
package_dir={"protontricks": "src/protontricks"},
install_requires=[
"vdf>=2.4"
],
setup_requires=["setuptools_scm"],
install_requires=["vdf>=2.4"],
entry_points={
"console_scripts": [
"protontricks = protontricks.cli:main"
Expand All @@ -47,6 +46,4 @@
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
],
cmdclass=versioneer.get_cmdclass()
)

8 changes: 5 additions & 3 deletions src/protontricks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from .gui import *
from .util import *

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
try:
from ._version import version as __version__
except ImportError:
# Package not installed
__version__ = "unknown"

0 comments on commit 02a668e

Please sign in to comment.