Skip to content

Commit 0ca36d5

Browse files
committed
[ENH] Update version and adjust requirements handling
Updated gempy version code generation and aligned the versions of gempy_engine and gempy_viewer in requirements. Also, the way requirements files are read in setup.py has been adjusted to better handle nested requirements files.
1 parent d5b965b commit 0ca36d5

File tree

4 files changed

+32
-8
lines changed

4 files changed

+32
-8
lines changed

gempy/_version.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# file generated by setuptools_scm
2+
# don't change, don't track in version control
3+
TYPE_CHECKING = False
4+
if TYPE_CHECKING:
5+
from typing import Tuple, Union
6+
VERSION_TUPLE = Tuple[Union[int, str], ...]
7+
else:
8+
VERSION_TUPLE = object
9+
10+
version: str
11+
__version__: str
12+
__version_tuple__: VERSION_TUPLE
13+
version_tuple: VERSION_TUPLE
14+
15+
__version__ = version = '2024.1.1.dev0+gf7526f54.d20240415'
16+
__version_tuple__ = version_tuple = (2024, 1, 1, 'dev0', 'gf7526f54.d20240415')

requirements/base-requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
- r requirements.txt
22

3-
gempy_viewer # This install matplotlib
3+
# This install matplotlib
4+
gempy_viewer==2024.1.2
45
pandas

requirements/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
gempy_engine # This install also numpy
1+
# This install also numpy
2+
gempy_engine==2024.1.3

setup.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
import os
12
from os import path
23

34
from setuptools import setup, find_packages
45

56

6-
def read_requirements(file_name):
7+
def read_requirements(file_name, base_path=""):
8+
# Construct the full path to the requirements file
9+
full_path = os.path.join(base_path, file_name)
710
requirements = []
8-
with open(file_name, "r", encoding="utf-8") as f:
11+
with open(full_path, "r", encoding="utf-8") as f:
912
for line in f:
1013
# Strip whitespace and ignore comments
1114
line = line.strip()
@@ -15,23 +18,26 @@ def read_requirements(file_name):
1518
# Handle -r directive
1619
if line.startswith("-r "):
1720
referenced_file = line.split()[1] # Extract the file name
18-
requirements.extend(read_requirements(referenced_file)) # Recursively read referenced file
21+
# Recursively read the referenced file, making sure to include the base path
22+
requirements.extend(read_requirements(referenced_file, base_path=base_path))
1923
else:
2024
requirements.append(line)
2125

2226
return requirements
2327

2428

29+
30+
2531
with open("README.md", "r") as fh:
2632
long_description = fh.read()
2733

2834
setup(
2935
name='gempy',
3036
packages=find_packages(exclude=('test', 'docs', 'examples')),
31-
install_requires=read_requirements("requirements/requirements.txt"),
37+
install_requires=read_requirements("requirements.txt", "requirements"),
3238
extras_require={
33-
"opt": read_requirements("requirements/optional-requirements.txt"),
34-
"base": read_requirements("requirements/base-requirements.txt"),
39+
"opt": read_requirements("optional-requirements.txt", "requirements"),
40+
"base": read_requirements("base-requirements.txt", "requirements"),
3541
},
3642
url='https://github.com/cgre-aachen/gempy',
3743
license='EUPL-1.2',

0 commit comments

Comments
 (0)