Skip to content

Commit

Permalink
Ready for v0.1.0 release (#16)
Browse files Browse the repository at this point in the history
* Renamed for publishing

* restructure files
  • Loading branch information
jimmychu0807 authored Sep 28, 2024
1 parent c4c6025 commit 8422618
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 27 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ pip install dhkdao-airdrop
dhkdao-airdrop --help

# Run script with api keys set in config.json
dhkdao_airdrop config.json -o output -t type
dhkdao-airdrop config.json -o output -t type

# Run script with api keys set in env vars
CRYPTOCOMPARE_APIKEY="cc-apikey" MINTSCAN_APIKEY="ms-apikey" dhkdao_airdrop config.json -o output -t type
CRYPTOCOMPARE_APIKEY="cc-apikey" MINTSCAN_APIKEY="ms-apikey" dhkdao-airdrop config.json -o output -t type
```

Options:
Expand Down
41 changes: 25 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,34 @@ build-backend = "pdm.backend"
name = "dhkdao-airdrop"
version = "0.1.0"
authors = [
{ name = "Jimmy Chu", email = "[email protected]" },
{ name = "Jimmy Chu", email = "[email protected]" },
]
description = "DHK dao airdrop scripts"
license = { file = "LICENSE" }
readme = "README.md"
requires-python = ">=3.10"
keywords = ["DHK", "DHK dao", "airdrop"]
dependencies = [
"pandas>=2.2.3",
"python-dotenv",
"numpy>=2.1.0",
"typer>=0.12.5",
"requests>=2.32.3",
"pandas>=2.2.3",
"python-dotenv",
"numpy>=2.1.0",
"typer>=0.12.5",
"requests>=2.32.3",
]

[tool.pdm.dev-dependencies]
lint = [
"flake8",
"black"
]
test = [
"pytest>=8.3.3",
"python-dotenv>=1.0.1"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.10"
]

[project.urls]
Homepage = "https://github.com/dhkdao/airdrop-scripts"
Documentation = "https://github.com/dhkdao/airdrop-scripts/blob/main/README.md"
Issues = "https://github.com/dhkdao/airdrop-scripts/issues"

[project.scripts]
dhkdao-airdrop = "dhkdao_airdrop:cli"

[tool.pdm]
distribution = true

Expand All @@ -43,5 +42,15 @@ test = "pytest"
"test:no-capture" = "pytest --capture=no tests"
lint = "flake8 src tests"
"lint:write" = "black src tests"
exe = "pdm run src/scripts/main.py"
exe = "pdm run src/main.py"
all = { composite = ["lint", "test"]}

[tool.pdm.dev-dependencies]
lint = [
"flake8",
"black"
]
test = [
"pytest>=8.3.3",
"python-dotenv>=1.0.1"
]
Empty file removed src/.keep
Empty file.
5 changes: 5 additions & 0 deletions src/dhkdao_airdrop/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .airdrop import Airdrop
from .cli import cli
from .utils import is_number, round_output, get_config_with_apikey_envs

__all__ = ["Airdrop", "cli", "is_number", "round_output", "get_config_with_apikey_envs"]
2 changes: 1 addition & 1 deletion src/scripts/airdrop.py → src/dhkdao_airdrop/airdrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from rich import print
from typing import Optional

from scripts.utils import is_number
from .utils import is_number


class Airdrop:
Expand Down
7 changes: 4 additions & 3 deletions src/scripts/main.py → src/dhkdao_airdrop/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from enum import Enum
from rich import print

from scripts import Airdrop, round_output, get_config_with_apikey_envs
from .airdrop import Airdrop
from .utils import round_output, get_config_with_apikey_envs


class OutputType(str, Enum):
Expand Down Expand Up @@ -31,7 +32,7 @@ def monthly_alloc(
] = OutputType.table,
):
"""
Compute the DHKdao monthly airdrop allocation based on staked value on various blockchains.
Compute the DHK dao monthly airdrop allocation based on staked value on various blockchains.
"""
config = get_config_with_apikey_envs(config)
airdrop = Airdrop(config)
Expand All @@ -54,5 +55,5 @@ def monthly_alloc(
print(result_output, file=fh)


if __name__ == "__main__":
def cli():
app()
File renamed without changes.
4 changes: 4 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from dhkdao_airdrop import cli

if __name__ == "__main__":
cli()
4 changes: 0 additions & 4 deletions src/scripts/__init__.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
import typer
from dotenv import load_dotenv
from scripts import Airdrop, get_config_with_apikey_envs
from dhkdao_airdrop import Airdrop, get_config_with_apikey_envs


load_dotenv()
Expand Down

0 comments on commit 8422618

Please sign in to comment.