Skip to content

Commit

Permalink
Merge 583d5bc into 594dd26
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed Aug 8, 2016
2 parents 594dd26 + 583d5bc commit 21f3dbd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 26 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -9,7 +9,6 @@

# these are generated at build time, and never checked in
/src/allmydata/_version.py
/src/allmydata/_appname.py

# these are generated too
/bin/tahoe
Expand Down
19 changes: 3 additions & 16 deletions setup.py
Expand Up @@ -30,19 +30,6 @@ def read_version_py(infname):
VERSION_PY_FILENAME = 'src/allmydata/_version.py'
version = read_version_py(VERSION_PY_FILENAME)

APPNAME='tahoe-lafs'
APPNAMEFILE = os.path.join('src', 'allmydata', '_appname.py')
APPNAMEFILESTR = "__appname__ = '%s'" % (APPNAME,)
try:
curappnamefilestr = open(APPNAMEFILE, 'rU').read()
except EnvironmentError:
# No file, or unreadable or something, okay then let's try to write one.
open(APPNAMEFILE, "w").write(APPNAMEFILESTR)
else:
if curappnamefilestr.strip() != APPNAMEFILESTR:
print("Error -- this setup.py file is configured with the 'application name' to be '%s', but there is already a file in place in '%s' which contains the contents '%s'. If the file is wrong, please remove it and setup.py will regenerate it and write '%s' into it." % (APPNAME, APPNAMEFILE, curappnamefilestr, APPNAMEFILESTR))
sys.exit(-1)

# Tahoe's dependencies are managed by the find_links= entry in setup.cfg and
# the _auto_deps.install_requires list, which is used in the call to setup()
# below.
Expand Down Expand Up @@ -214,8 +201,8 @@ def run(self):
""")

def try_from_git(self):
# If we change APPNAME, the release tag names should also change from then on.
versions = versions_from_git(APPNAME + '-')
# If we change the release tag names, we must change this too
versions = versions_from_git("tahoe-lafs-")

# setup.py might be run by either py2 or py3 (when run by tox, which
# uses py3 on modern debian/ubuntu distros). We want this generated
Expand All @@ -241,7 +228,7 @@ def try_from_git(self):
if version:
setup_args["version"] = version

setup(name=APPNAME,
setup(name="tahoe-lafs", # also set in __init__.py
description='secure, decentralized, fault-tolerant file store',
long_description=open('README.rst', 'rU').read(),
author='the Tahoe-LAFS project',
Expand Down
11 changes: 3 additions & 8 deletions src/allmydata/__init__.py
Expand Up @@ -30,15 +30,10 @@ class PackagingError(EnvironmentError):
# branch is. This should not happen very often.
pass

__appname__ = "unknown"
try:
from allmydata._appname import __appname__
except ImportError:
# We're running in a tree that hasn't run "./setup.py". This shouldn't happen.
pass
__appname__ = "tahoe-lafs"

# __full_version__ is the one that you ought to use when identifying yourself in the
# "application" part of the Tahoe versioning scheme:
# __full_version__ is the one that you ought to use when identifying yourself
# in the "application" part of the Tahoe versioning scheme:
# https://tahoe-lafs.org/trac/tahoe-lafs/wiki/Versioning
__full_version__ = __appname__ + '/' + str(__version__)

Expand Down
2 changes: 1 addition & 1 deletion src/allmydata/test/test_runner.py
Expand Up @@ -14,7 +14,7 @@
from allmydata.client import Client
from allmydata.test import common_util
import allmydata
from allmydata._appname import __appname__
from allmydata import __appname__


timeout = 240
Expand Down

0 comments on commit 21f3dbd

Please sign in to comment.