mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-07-27 17:27:43 +00:00
refactor: centralize versioning and stabilize PMA validation
This commit is contained in:
@@ -1,13 +1,5 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"gitversion.tool": {
|
||||
"version": "6.5.1",
|
||||
"commands": [
|
||||
"dotnet-gitversion"
|
||||
],
|
||||
"rollForward": false
|
||||
}
|
||||
}
|
||||
"tools": {}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
+7
-12
@@ -1,5 +1,12 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<QtaVersionFile>$(MSBuildThisFileDirectory)lib/VERSION</QtaVersionFile>
|
||||
<QtaVersion Condition="Exists('$(QtaVersionFile)')">$([System.IO.File]::ReadAllText('$(QtaVersionFile)').Trim())</QtaVersion>
|
||||
<Version Condition="'$(QtaVersion)' != ''">$(QtaVersion)</Version>
|
||||
<PackageVersion Condition="'$(QtaVersion)' != ''">$(QtaVersion)</PackageVersion>
|
||||
<AssemblyVersion Condition="'$(QtaVersion)' != ''">$(QtaVersion).0</AssemblyVersion>
|
||||
<FileVersion Condition="'$(QtaVersion)' != ''">$(QtaVersion).0</FileVersion>
|
||||
<InformationalVersion Condition="'$(QtaVersion)' != ''">$(QtaVersion)</InformationalVersion>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<NoWarn>$(NoWarn);NU1903;NU5104</NoWarn>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
@@ -90,20 +97,8 @@
|
||||
</AdditionalFiles>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- GitVersion: skip during design-time builds and restore to prevent VS Code/OmniSharp hangs.
|
||||
GitVersion scans entire git history on every MSBuild evaluation; with 50+ untracked files
|
||||
and VS Code's C# extension triggering continuous design-time builds, this causes infinite
|
||||
process accumulation. Only run GitVersion during actual CLI builds. -->
|
||||
<PropertyGroup Condition="'$(DesignTimeBuild)' == 'true' OR '$(BuildingProject)' != 'true'">
|
||||
<GitVersionSkip>true</GitVersionSkip>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
|
||||
<PackageReference Include="GitVersion.MsBuild" Version="6.5.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Roslynator.Analyzers" Version="4.12.9">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
|
||||
@@ -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: {}
|
||||
@@ -0,0 +1 @@
|
||||
0.8.0
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Title>QuanTAlib</Title>
|
||||
@@ -23,11 +23,6 @@
|
||||
<PackageIconUrl>https://raw.githubusercontent.com/mihakralj/QuanTAlib/main/docs/img/QuanTAlib2.png</PackageIconUrl>
|
||||
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
<Version>$(GitVersion_MajorMinorPatch)</Version>
|
||||
<PackageVersion>$(GitVersion_MajorMinorPatch)</PackageVersion>
|
||||
<AssemblyVersion>$(GitVersion_AssemblySemVer)</AssemblyVersion>
|
||||
<FileVersion>$(GitVersion_AssemblySemFileVer)</FileVersion>
|
||||
<InformationalVersion>$(GitVersion_InformationalVersion)</InformationalVersion>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<UserSecretsId>6afc11a7-4355-4f5e-9fdf-22431e5b03cb</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<GitVersionSkip>true</GitVersionSkip>
|
||||
<IlcOptimizationPreference>Speed</IlcOptimizationPreference>
|
||||
<RunAnalyzers>false</RunAnalyzers>
|
||||
<ErrorReport>none</ErrorReport>
|
||||
|
||||
@@ -525,7 +525,6 @@ When pandas is not installed:
|
||||
```xml
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<GitVersionSkip>true</GitVersionSkip>
|
||||
<IlcOptimizationPreference>Speed</IlcOptimizationPreference>
|
||||
<RunAnalyzers>false</RunAnalyzers>
|
||||
<ErrorReport>none</ErrorReport>
|
||||
|
||||
@@ -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<version>\\d+\\.\\d+\\.\\d+)"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["quantalib"]
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user