Skip to content

Commit

Permalink
Upadte Setup.py
Browse files Browse the repository at this point in the history
Update setup.py to have a dynamic version.
  • Loading branch information
dcajasn committed Mar 17, 2023
1 parent 4dd2044 commit bd1260c
Show file tree
Hide file tree
Showing 19 changed files with 48 additions and 23 deletions.
9 changes: 6 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import os
import sys
import sphinx_rtd_theme
import riskfolio as rp

sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(1, os.path.abspath('../../riskfolio'))
Expand All @@ -23,13 +24,15 @@
# -- Project information -----------------------------------------------------

project = 'Riskfolio-Lib'
copyright = '2020-2022, Dany Cajas'
copyright = '2020-2023, Dany Cajas'
author = 'Dany Cajas'

__version__ = rp.__version__

# The short X.Y version
version = 'latest'
version = '.'.join(__version__.split('.')[:2])
# The full version, including alpha/beta/rc tags
release = '4.0.3'
release = __version__


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ If you use Riskfolio-Lib for published work, please use the following BibTeX ent

@misc{riskfolio,
author = {Dany Cajas},
title = {Riskfolio-Lib (4.0.0)},
title = {Riskfolio-Lib (4.0.3)},
year = {2022},
url = {https://github.com/dcajasn/Riskfolio-Lib},
}
Expand Down
5 changes: 2 additions & 3 deletions riskfolio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
"""""" #
"""
Copyright (c) 2020-2022, Dany Cajas
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
"""

from riskfolio.src import *
from riskfolio.external import *

__version__ = "4.0.3"
from riskfolio.version import (version as __version__,) # riskfolio/version.py is auto-generated
2 changes: 1 addition & 1 deletion riskfolio/external/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""""" #
"""
Copyright (c) 2020-2022, Dany Cajas
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion riskfolio/external/cpp_functions_bindings.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022, Dany Cajas
* Copyright (c) 2020-2023, Dany Cajas
* All rights reserved.
* This work is licensed under BSD 3-Clause "New" or "Revised" License.
* License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
8 changes: 8 additions & 0 deletions riskfolio/external/cppfunctions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
"""""" #
"""
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
"""

from riskfolio.external.functions import *


Expand Down
2 changes: 1 addition & 1 deletion riskfolio/external/matrix_functions.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022, Dany Cajas
* Copyright (c) 2020-2023, Dany Cajas
* All rights reserved.
* This work is licensed under BSD 3-Clause "New" or "Revised" License.
* License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion riskfolio/src/AuxFunctions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""""" #
"""
Copyright (c) 2020-2022, Dany Cajas
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion riskfolio/src/ConstraintsFunctions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""""" #
"""
Copyright (c) 2020-2022, Dany Cajas
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion riskfolio/src/DBHT.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""""" #
"""
Copyright (c) 2020-2022, Dany Cajas
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion riskfolio/src/HCPortfolio.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""""" #
"""
Copyright (c) 2020-2022, Dany Cajas
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion riskfolio/src/OwaWeights.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""""" #
"""
Copyright (c) 2020-2022, Dany Cajas
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion riskfolio/src/ParamsEstimation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""""" #
"""
Copyright (c) 2020-2022, Dany Cajas
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion riskfolio/src/PlotFunctions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""""" #
"""
Copyright (c) 2020-2022, Dany Cajas
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion riskfolio/src/Portfolio.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""""" #
"""
Copyright (c) 2020-2022, Dany Cajas
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion riskfolio/src/Reports.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""""" #
"""
Copyright (c) 2020-2022, Dany Cajas
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion riskfolio/src/RiskFunctions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""""" #
"""
Copyright (c) 2020-2022, Dany Cajas
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion riskfolio/src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""""" #
"""
Copyright (c) 2020-2022, Dany Cajas
Copyright (c) 2020-2023, Dany Cajas
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
Expand Down
19 changes: 17 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
# Copyright (C) 2020-2022 Dany Cajas
# Copyright (C) 2020-2023 Dany Cajas

import os
import numpy as np

from pybind11.setup_helpers import Pybind11Extension, build_ext
from setuptools import setup

MAJOR = 4
MINOR = 0
MICRO = 3
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

def write_version_py(filename='riskfolio/version.py'):
cnt = """
# THIS FILE IS GENERATED FROM RISKFOLIO-LIB SETUP.PY
short_version = '%(version)s'
"""
a = open(filename, 'w')
try:
a.write(cnt % {'version': VERSION,})
finally:
a.close()

DESCRIPTION = "Portfolio Optimization and Quantitative Strategic Asset Allocation in Python"

with open("README.md", encoding='UTF-8') as fh:
Expand All @@ -18,7 +34,6 @@
LICENSE = 'BSD (3-clause)'
KEYWORDS = 'finance, portfolio, optimization, quant, asset, allocation, investing'
DOWNLOAD_URL = 'https://github.com/dcajasn/Riskfolio-Lib.git'
VERSION = '4.0.3'
PYTHON_REQUIRES = ">=3.7"

INSTALL_REQUIRES = [
Expand Down

0 comments on commit bd1260c

Please sign in to comment.