Skip to content

Commit

Permalink
Merge pull request #50 from deronnax/migrate_to_setup_cfg
Browse files Browse the repository at this point in the history
migrate to setup.cfg
  • Loading branch information
oz123 committed Oct 22, 2023
2 parents 9ab55de + 84c3056 commit 4736271
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 32 deletions.
11 changes: 11 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[metadata]
version = attr: plette.__version__

[options]
package_dir =
= src
packages = find:
include_package_data = True

[options.packages.find]
where = src
34 changes: 2 additions & 32 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
import ast
import os
from setuptools import setup

from setuptools import find_packages, setup


ROOT = os.path.dirname(__file__)

PACKAGE_NAME = 'plette'

VERSION = None

with open(os.path.join(ROOT, 'src', PACKAGE_NAME, '__init__.py')) as f:
for line in f:
if line.startswith('__version__ = '):
VERSION = ast.literal_eval(line[len('__version__ = '):].strip())
break
if VERSION is None:
raise EnvironmentError('failed to read version')


setup(
# These really don't work.
package_dir={'': 'src'},
packages=find_packages('src'),

package_data={
'': ['LICENSE*', 'README*'],
},

# I need this to be dynamic.
version=VERSION,
)
setup()

0 comments on commit 4736271

Please sign in to comment.