Skip to content

Commit

Permalink
Merge pull request #341 from WadeBarnes/master
Browse files Browse the repository at this point in the history
Fix metadata.json file not found error during install.
  • Loading branch information
swcurran committed Jan 24, 2023
2 parents 1314e85 + c180af8 commit cedde31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@


try:
SETUP_DIRNAME = os.path.dirname(__file__)
SETUP_DIRNAME = os.path.abspath(os.path.dirname(__file__))
except NameError:
# We're probably being frozen, and __file__ triggered this NameError
# Work around this
SETUP_DIRNAME = os.path.dirname(sys.argv[0])
SETUP_DIRNAME = os.path.abspath(os.path.dirname(sys.argv[0]))

if SETUP_DIRNAME != '':
os.chdir(SETUP_DIRNAME)
# if SETUP_DIRNAME != '':
# os.chdir(SETUP_DIRNAME)

SETUP_DIRNAME = os.path.abspath(SETUP_DIRNAME)
# SETUP_DIRNAME = os.path.abspath(SETUP_DIRNAME)

METADATA = os.path.join(SETUP_DIRNAME, 'sovrin', '__metadata__.py')
# Load the metadata using exec()
# so we don't trigger an import of ioflo.__init__
exec(compile(open(METADATA).read(), METADATA, 'exec'))
METADATA = {'__file__': os.path.join(SETUP_DIRNAME, 'sovrin', '__metadata__.py')}

with open(METADATA['__file__'], 'r') as f:
exec(f.read(), METADATA)

setup(
name='sovrin',
version=__version__,
version=METADATA['__version__'],
description='Sovrin node',
url='https://github.com/sovrin-foundation/sovrin',
author=__author__,
author=METADATA['__author__'],
author_email='[email protected]',
license=__license__,
license=METADATA['__license__'],
keywords='Sovrin Genesis Transactions',
packages=find_packages(exclude=['docs', 'docs*']),
package_data={
Expand Down
2 changes: 1 addition & 1 deletion sovrin/__metadata__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import json

METADATA_FILENAME = 'sovrin/metadata.json'
METADATA_FILENAME = 'metadata.json'
METADATA_FILE = os.path.join(
os.path.abspath(os.path.dirname(__file__)), METADATA_FILENAME)

Expand Down

0 comments on commit cedde31

Please sign in to comment.