Skip to content

Commit

Permalink
Update to Python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaczero committed Nov 12, 2024
1 parent 7312b21 commit 50d20a9
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 224 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,4 @@ pyrightconfig.json

# application specific
output
*.ignore
22 changes: 13 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: main.py",
"type": "python",
"console": "integratedTerminal",
"name": "Python Debugger: Current File",
"program": "${file}",
"request": "launch",
"program": "${workspaceFolder}/main.py",
"type": "debugpy"
},
{
"console": "integratedTerminal",
"justMyCode": true
"justMyCode": true,
"name": "Python: main.py",
"program": "${workspaceFolder}/main.py",
"request": "launch",
"type": "debugpy"
}
]
],
"version": "0.2.0"
}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# ColinTalksCrypto Bitcoin Bull Run Index (CBBI)

![Python version](https://shields.monicz.dev/badge/python-v3.12-blue)
[![Project license](https://shields.monicz.dev/github/license/Zaczero/CBBI)](https://github.com/Zaczero/CBBI/blob/main/LICENSE)
![Python version](https://shields.monicz.dev/badge/python-v3.13-blue)
[![GitHub Repo stars](https://shields.monicz.dev/github/stars/Zaczero/CBBI?style=social)](https://github.com/Zaczero/CBBI)

The official Python implementation of the **ColinTalksCrypto Bitcoin Bull Run Index** (CBBI).
Expand Down
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ with pkgs; let
paths = [
(pkgs.runCommand "python-venv" { } ''
mkdir -p $out/lib
cp -r "${./.venv/lib/python3.12/site-packages}"/* $out/lib
cp -r "${./.venv/lib/python3.13/site-packages}"/* $out/lib
'')
];
};
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
import time
import traceback
from pathlib import Path
Expand All @@ -6,7 +7,6 @@
import numpy as np
import pandas as pd
import seaborn as sns
import uvloop
from matplotlib import pyplot as plt
from pyfiglet import figlet_format
from sty import bg, ef, fg, rs
Expand Down Expand Up @@ -173,7 +173,7 @@ def run_and_retry(

for _ in range(max_attempts):
try:
uvloop.run(run(json_file, charts_file, output_dir))
asyncio.run(run(json_file, charts_file, output_dir))
exit(0)

except Exception:
Expand Down
11 changes: 3 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ dependencies = [
"seaborn",
"sty",
"tqdm",
"uvloop",
]
name = "cbbi"
requires-python = "~=3.12"
requires-python = "~=3.13"
version = "0.0.0"

[tool.uv]
Expand Down Expand Up @@ -54,14 +53,14 @@ exclude = [

indent-width = 4
line-length = 120
target-version = "py312"
target-version = "py313"

[tool.ruff.lint]
ignore = [
"S101", # assert
]
# see https://docs.astral.sh/ruff/rules/ for rules documentation
select = [
# see https://docs.astral.sh/ruff/rules/ for rules documentation
"A", # flake8-builtins
"ARG", # flake8-unused-argumentsf
"ASYNC", # flake8-async
Expand Down Expand Up @@ -102,13 +101,9 @@ select = [
"YTT", # flake8-2020
]

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.format]
quote-style = "single"

Expand Down
7 changes: 3 additions & 4 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{ isDevelopment ? true }:

let
# Currently using nixpkgs-unstable
# Update with `nixpkgs-update` command
pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/4f31540079322e6013930b5b2563fd10f96917f0.tar.gz") { };
pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/85f7e662eda4fa3a995556527c87b2524b691933.tar.gz") { };

pythonLibs = with pkgs; [
stdenv.cc.cc.lib
zlib.out
];
python' = with pkgs; (symlinkJoin {
name = "python";
paths = [ python312 ];
paths = [ python313 ];
buildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram "$out/bin/python3.12" --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath pythonLibs}"
wrapProgram "$out/bin/python3.13" --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath pythonLibs}"
'';
});

Expand Down
286 changes: 88 additions & 198 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit 50d20a9

Please sign in to comment.