From 14a9b5dbad17eab2eed269552b7fb2ba7583a750 Mon Sep 17 00:00:00 2001 From: Carlos da Costa Date: Sun, 15 Jan 2023 21:46:38 -0800 Subject: [PATCH] feat: scm versioning (#10) * feat: scm versioning * fix: remove old versions * fix: update copyright --- LICENSE | 2 +- cpp/fdct2d_wrapper.cpp | 2 +- cpp/fdct3d_wrapper.cpp | 2 +- curvelops/__init__.py | 8 ++++++++ curvelops/curvelops.py | 3 --- docs/source/conf.py | 10 ++++------ setup.py | 8 +++++--- 7 files changed, 20 insertions(+), 15 deletions(-) diff --git a/LICENSE b/LICENSE index 5408246..7b2c235 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Carlos da Costa +Copyright (c) 2020-2023 Carlos da Costa Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/cpp/fdct2d_wrapper.cpp b/cpp/fdct2d_wrapper.cpp index 42f5a51..8374f7c 100644 --- a/cpp/fdct2d_wrapper.cpp +++ b/cpp/fdct2d_wrapper.cpp @@ -1,5 +1,5 @@ /* fdct2d_wrapper (Pybind11 wrapper for Fast 2D Curvelet Wrapping Transform) - Copyright (C) 2020 Carlos Alberto da Costa Filho + Copyright (C) 2020-2023 Carlos Alberto da Costa Filho ${CXX} -O3 -Wall -shared -std=c++11 -fPIC \ -I${FFTW}/fftw `python3 -m pybind11 --includes` \ diff --git a/cpp/fdct3d_wrapper.cpp b/cpp/fdct3d_wrapper.cpp index 0ba657c..b9bfdb3 100644 --- a/cpp/fdct3d_wrapper.cpp +++ b/cpp/fdct3d_wrapper.cpp @@ -1,5 +1,5 @@ /* fdct3d_wrapper (Pybind11 wrapper for Fast 3D Curvelet Wrapping Transform) - Copyright (C) 2020 Carlos Alberto da Costa Filho + Copyright (C) 2020-2023 Carlos Alberto da Costa Filho ${CXX} -O3 -Wall -shared -std=c++11 -fPIC \ -I${FFTW}/fftw `python3 -m pybind11 --includes` \ diff --git a/curvelops/__init__.py b/curvelops/__init__.py index 9fdd734..a7c9aaf 100644 --- a/curvelops/__init__.py +++ b/curvelops/__init__.py @@ -1 +1,9 @@ from .curvelops import * + + +try: + from ._version import __version__ +except ImportError: + from datetime import datetime + + __version__ = "0.0.unknown+" + datetime.today().strftime("%Y%m%d") diff --git a/curvelops/curvelops.py b/curvelops/curvelops.py index 9a4e848..d681a5d 100644 --- a/curvelops/curvelops.py +++ b/curvelops/curvelops.py @@ -2,9 +2,6 @@ Provides a LinearOperator for the 2D and 3D curvelet transforms. """ -__version__ = "0.21" -__author__ = "Carlos Alberto da Costa Filho" - from itertools import product from typing import List, Optional, Tuple, Callable, Union, Sequence import numpy as np diff --git a/docs/source/conf.py b/docs/source/conf.py index 4e79865..d2b391b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -16,18 +16,16 @@ # import sys # sys.path.insert(0, os.path.abspath('.')) +from curvelops import __version__ as version + +release = version # -- Project information ----------------------------------------------------- project = "curvelops" -copyright = "2020, Carlos Alberto da Costa Filho" +copyright = "2020-2023, Carlos Alberto da Costa Filho" author = "Carlos Alberto da Costa Filho" -# The short X.Y version -version = "" -# The full version, including alpha/beta/rc tags -release = "0.21" - # -- General configuration --------------------------------------------------- diff --git a/setup.py b/setup.py index 14daeeb..59e16d5 100644 --- a/setup.py +++ b/setup.py @@ -15,10 +15,9 @@ from pybind11.setup_helpers import Pybind11Extension, build_ext NAME = "curvelops" -VERSION = "0.21" AUTHOR = "Carlos Alberto da Costa Filho" AUTHOR_EMAIL = "c.dacostaf@gmail.com" -URL = "https://github.com/pylops/curvelops" +URL = "https://github.com/PyLops/curvelops" DESCRIPTION = "Python wrapper for CurveLab's 2D and 3D curvelet transforms" LICENSE = "MIT" @@ -104,7 +103,6 @@ setup( name=NAME, - version=VERSION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, @@ -125,7 +123,11 @@ setup_requires=[ "pybind11>=2.6.0; python_version < '3.10'", "pybind11>=2.10.0; python_version >= '3.11'", + "setuptools_scm", ], + use_scm_version=dict( + root=".", relative_to=__file__, write_to=f"{NAME}/_version.py" + ), license=LICENSE, test_suite="pytests", tests_require=["pytest"],