Skip to content

Commit 89b2695

Browse files
committed
update build conf
1 parent 3df0542 commit 89b2695

5 files changed

Lines changed: 15 additions & 33 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ __pycache__/*
1919
.pydevproject
2020
.settings
2121
.idea
22+
.vscode
2223
tags
24+
src/twelvedata/_version.py
2325

2426
# Package files
2527
*.egg

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[build-system]
2-
requires = ["setuptools", "wheel"]
3-
build-backend = "setuptools.build_meta:__legacy__"
2+
requires = ["setuptools>=45", "wheel", "setuptools-scm[toml]>=6.2"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
write_to = "src/twelvedata/_version.py"

setup.cfg

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ packages = find:
2323
include_package_data = True
2424
package_dir =
2525
=src
26-
# DON'T CHANGE THE FOLLOWING LINE! IT WILL BE UPDATED BY PYSCAFFOLD!
27-
setup_requires = pyscaffold>=3.1a0,<3.2a0
2826
install_requires =
2927
pytimeparse>=1.1,<2
3028
requests>=2.22,<3
@@ -89,8 +87,6 @@ build = bdist_wheel
8987
release = build upload
9088

9189
[bdist_wheel]
92-
# Use this option if your package is pure-python
93-
universal = 1
9490

9591
[build_sphinx]
9692
source_dir = docs
@@ -110,9 +106,3 @@ exclude =
110106
dist
111107
.eggs
112108
docs/conf.py
113-
114-
[pyscaffold]
115-
# PyScaffold's parameters when the project was created.
116-
# This will be used when updating. Do not change!
117-
version = 3.1
118-
package = twelvedata

setup.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,8 @@
33
"""
44
Setup file for twelvedata.
55
Use setup.cfg to configure your project.
6-
7-
This file was generated with PyScaffold 3.1.
8-
PyScaffold helps you to put up the scaffold of your new Python project.
9-
Learn more under: https://pyscaffold.org/
106
"""
11-
import sys
12-
13-
from pkg_resources import require, VersionConflict
147
from setuptools import setup
158

16-
try:
17-
require('setuptools>=38.3')
18-
except VersionConflict:
19-
print("Error: version of setuptools is too old (<38.3)!")
20-
sys.exit(1)
21-
22-
239
if __name__ == "__main__":
24-
setup(use_pyscaffold=True)
10+
setup()

src/twelvedata/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# -*- coding: utf-8 -*-
2-
import importlib.metadata
32
from .client import TDClient
43

54
try:
6-
# Change here if project is renamed and does not equal the package name
7-
dist_name = __name__
8-
__version__ = importlib.metadata.version(dist_name)
9-
except ImportError as e:
10-
__version__ = "unknown"
5+
from ._version import version as __version__
6+
except ImportError:
7+
try:
8+
import importlib.metadata
9+
__version__ = importlib.metadata.version(__name__)
10+
except Exception:
11+
__version__ = "unknown"

0 commit comments

Comments
 (0)