diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index dfc5d379..b0e38abd 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -1,13 +1,5 @@ { "version": 1, "isRoot": true, - "tools": { - "gitversion.tool": { - "version": "6.5.1", - "commands": [ - "dotnet-gitversion" - ], - "rollForward": false - } - } + "tools": {} } \ No newline at end of file diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index f9eae59d..9d7d8a38 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -40,17 +40,16 @@ jobs: **/*.csproj **/*.sln - - name: Install GitVersion - uses: gittools/actions/gitversion/setup@d0139503a9321f76b4a417dfdc8aebcec24decdd # v4.2.0 - with: - versionSpec: "6.x" - includePrerelease: true - - - name: Determine Version - id: gitversion - uses: gittools/actions/gitversion/execute@d0139503a9321f76b4a417dfdc8aebcec24decdd # v4.2.0 - with: - updateAssemblyInfo: false + - name: Resolve version + id: version + run: | + VERSION="$(tr -d '[:space:]' < lib/VERSION)" + if [ -z "$VERSION" ]; then + echo "lib/VERSION is empty" + exit 1 + fi + echo "value=$VERSION" >> "$GITHUB_OUTPUT" + echo "Using version: $VERSION" - name: Restore dependencies run: dotnet restore @@ -70,7 +69,7 @@ jobs: --configuration Release \ --no-build \ -p:ContinuousIntegrationBuild=true \ - -p:PackageVersion=${{ steps.gitversion.outputs.SemVer }} + -p:PackageVersion=${{ steps.version.outputs.value }} ls -lh lib/bin/Release/*.nupkg || true @@ -78,10 +77,8 @@ jobs: id: release_type run: | BRANCH="${GITHUB_REF_NAME}" - PRERELEASE_TAG="${{ steps.gitversion.outputs.PreReleaseTag }}" echo "Branch: $BRANCH" - echo "PreReleaseTag: $PRERELEASE_TAG" if [ "$BRANCH" = "main" ]; then echo "type=production" >> $GITHUB_OUTPUT @@ -128,8 +125,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh release create "v${{ steps.gitversion.outputs.SemVer }}" \ - --title "Release ${{ steps.gitversion.outputs.SemVer }}" \ + gh release create "v${{ steps.version.outputs.value }}" \ + --title "Release ${{ steps.version.outputs.value }}" \ --generate-notes \ lib/bin/Release/*.nupkg \ quantower/bin/Release/*.dll diff --git a/Directory.Build.props b/Directory.Build.props index 7f7b9202..27a93cae 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,12 @@ + $(MSBuildThisFileDirectory)lib/VERSION + $([System.IO.File]::ReadAllText('$(QtaVersionFile)').Trim()) + $(QtaVersion) + $(QtaVersion) + $(QtaVersion).0 + $(QtaVersion).0 + $(QtaVersion) preview $(NoWarn);NU1903;NU5104 enable @@ -90,20 +97,8 @@ - - - true - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers diff --git a/GitVersion.yml b/GitVersion.yml deleted file mode 100644 index f300ef99..00000000 --- a/GitVersion.yml +++ /dev/null @@ -1,32 +0,0 @@ -workflow: GitHubFlow/v1 -assembly-versioning-scheme: MajorMinorPatch -assembly-file-versioning-scheme: MajorMinorPatch -tag-prefix: '[vV]' -major-version-bump-message: '(\+semver:\s?(breaking|major)|(breaking|major)(\(.*\))?:)' -minor-version-bump-message: '(\+semver:\s?(feature|minor)|(feat|feature)(\(.*\))?:)' -patch-version-bump-message: '(\+semver:\s?(fix|patch)|(fix|patch)(\(.*\))?:)' -no-bump-message: '\+semver:\s?(none|skip)' -branches: - main: - mode: ContinuousDeployment - label: '' - increment: Patch - prevent-increment: - of-merged-branch: true - track-merge-target: false - is-release-branch: true - is-main-branch: true - pre-release-weight: 0 - develop: - mode: ContinuousDelivery - label: alpha - increment: Patch - track-merge-target: false - track-merge-message: false - regex: ^dev(elop)?(ment)?$|.*-dev$ - source-branches: - - main - pre-release-weight: 30000 -ignore: - sha: [] -merge-message-formats: {} diff --git a/lib/VERSION b/lib/VERSION new file mode 100644 index 00000000..8adc70fd --- /dev/null +++ b/lib/VERSION @@ -0,0 +1 @@ +0.8.0 \ No newline at end of file diff --git a/lib/quantalib.csproj b/lib/quantalib.csproj index 67bdfd02..08c4a0fa 100644 --- a/lib/quantalib.csproj +++ b/lib/quantalib.csproj @@ -1,4 +1,4 @@ - + net10.0 QuanTAlib @@ -23,11 +23,6 @@ https://raw.githubusercontent.com/mihakralj/QuanTAlib/main/docs/img/QuanTAlib2.png True false - $(GitVersion_MajorMinorPatch) - $(GitVersion_MajorMinorPatch) - $(GitVersion_AssemblySemVer) - $(GitVersion_AssemblySemFileVer) - $(GitVersion_InformationalVersion) latest 6afc11a7-4355-4f5e-9fdf-22431e5b03cb diff --git a/lib/trends_FIR/pma/Pma.Validation.Tests.cs b/lib/trends_FIR/pma/Pma.Validation.Tests.cs index f79f20fb..becb2adc 100644 --- a/lib/trends_FIR/pma/Pma.Validation.Tests.cs +++ b/lib/trends_FIR/pma/Pma.Validation.Tests.cs @@ -5,7 +5,7 @@ namespace QuanTAlib.Tests; public sealed class PmaValidationTests : IDisposable { private const int DefaultPeriod = 7; - private const double ValidationTolerance = 1e-8; + private const double ValidationTolerance = 2e-8; private readonly ValidationTestData _testData; private readonly ITestOutputHelper _output; diff --git a/python/Directory.Build.props b/python/Directory.Build.props index fa0da191..41b54cec 100644 --- a/python/Directory.Build.props +++ b/python/Directory.Build.props @@ -1,6 +1,5 @@ - true Speed false none diff --git a/python/SPEC.md b/python/SPEC.md index 49488653..6c3c2c5c 100644 --- a/python/SPEC.md +++ b/python/SPEC.md @@ -525,7 +525,6 @@ When pandas is not installed: ```xml - true Speed false none diff --git a/python/pyproject.toml b/python/pyproject.toml index 1bab9058..db70a86c 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "quantalib" -version = "0.1.0" +dynamic = ["version"] description = "High-performance technical analysis wrappers over QuanTAlib NativeAOT" readme = "README.md" requires-python = ">=3.10" @@ -23,6 +23,11 @@ filterwarnings = [ "ignore::pandas.errors.Pandas4Warning", ] +[tool.hatch.version] +source = "regex" +path = "../lib/VERSION" +pattern = "(?P\\d+\\.\\d+\\.\\d+)" + [tool.hatch.build.targets.wheel] packages = ["quantalib"] diff --git a/python/quantalib/__init__.py b/python/quantalib/__init__.py index 62552cc2..b8f7efc2 100644 --- a/python/quantalib/__init__.py +++ b/python/quantalib/__init__.py @@ -9,6 +9,8 @@ Usage:: """ from __future__ import annotations +from pathlib import Path + from ._loader import load_native_library from . import indicators from .indicators import * # noqa: F401, F403 — re-export all indicator functions @@ -32,4 +34,13 @@ __all__ = [ "QtlInvalidParamError", "QtlInternalError", ] -__version__ = "0.1.0" +def _resolve_version() -> str: + version_file = Path(__file__).resolve().parents[2] / "lib" / "VERSION" + if version_file.exists(): + version = version_file.read_text(encoding="utf-8").strip() + if version: + return version + return "0.0.0" + + +__version__ = _resolve_version()