Skip to content

Commit

Permalink
chore: pyblish workflow updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Aviksaikat committed Jul 13, 2024
1 parent 3881951 commit 65a1145
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,21 @@ jobs:
run: |
hatch build
- name: Publish 📦 to Test PyPI
if: startsWith(github.ref, 'refs/heads/main')
# As the github.ref will come from release tag that's why it's commented out
# if: startsWith(github.ref, 'refs/heads/main')
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
user: __token__
password: ${{ secrets.TEST_PYPI_SECRECT }}
packages-dir: dist/
verbose: true
# packages-dir: dist/
repository-url: https://test.pypi.org/legacy/
- name: Publish 📦 to PyPI
if: startsWith(github.ref, 'refs/heads/main')
# if: startsWith(github.ref, 'refs/heads/main')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_SECRECT }}
packages-dir: dist/
verbose: true
# packages-dir: dist/
21 changes: 19 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,23 @@ dependencies = [
"rich-click", # https://github.com/ewels/rich-click
]


# Cli tool name & options
[project.scripts]
ape_utils = "ape_utils._cli:cli"


# Make it work with cli like ape call, ape abi_encode etc.
[project.entry-points.ape_cli_subcommands]
ape_utils = "ape_utils._cli:cli"


[project.urls]
Documentation = "https://github.com/Aviksaikat/ape-utils#readme"
Issues = "https://github.com/Aviksaikat/ape-utils/issues"
Source = "https://github.com/Aviksaikat/ape-utils"


[tool.hatch.version]
source = "regex_commit"
commit_extra_args = ["-e"]
Expand Down Expand Up @@ -78,6 +82,7 @@ include = [
]
exclude = ["tests", "src/ape_utils/_version.py"]


[tool.ruff.lint]
preview = true # preview features & checks, use with caution
extend-select = [ # features in preview
Expand Down Expand Up @@ -127,6 +132,7 @@ ignore = [
"ISC001", # causes unexpected behaviour with formatter
]


[tool.ruff.lint.isort]
known-first-party = ["ape_utils"]

Expand All @@ -150,25 +156,26 @@ omit = [
"src/ape_utils/__version__.py",
]


[tool.coverage.paths]
ape_utils = ["src/ape_utils", "*/ape_utils/src/ape_utils"]
tests = ["tests", "*/ape_utils/tests"]


[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]

# [tool.hatch.build.targets.wheel]
# include = ["**/*", "LICENSE", "README.md"]

[tool.hatch.envs.default]
installer = "pip"
# dependencies = []
post-install-commands = ["pre-commit install"]


[tool.hatch.envs.lint]
# If you define environments with dependencies that only slightly differ from their
# inherited environments, you can use the extra-dependencies option to avoid redeclaring the
Expand All @@ -182,6 +189,8 @@ extra-dependencies = [
"mdformat-frontmatter>=0.4.1",
"mdformat-pyproject>=0.0.1",
]


[tool.hatch.envs.lint.scripts]
# check = "mypy --install-types --non-interactive {args:ape_utils tests}"
typing = [
Expand All @@ -205,6 +214,7 @@ lint-check = [
"mypy src/ape_utils/"
]


# Docs env dendencies
[tool.hatch.envs.docs]
dependencies = [
Expand All @@ -216,6 +226,7 @@ dependencies = [
"ape_utils @ {root:uri}/"
]


[tool.hatch.envs.docs.scripts]
docs-serve = "mkdocs serve"
docs-build = "mkdocs build --clean --strict"
Expand All @@ -227,29 +238,35 @@ build-check = [
"validate",
]


[tool.hatch.envs.test]
extra-dependencies = ["pytest", "pytest-xdist", "pytest-cov", "hypothesis"]


[tool.hatch.envs.test.scripts]
test = "pytest"
test-cov-xml = "pytest --cov-report=xml"


[tool.pytest.ini_options]
addopts = "-p no:ape_test"
python_files = "test_*.py"
testpaths = "tests"


# Replace tox & nox
[[tool.hatch.envs.test.matrix]]
python = ["3.9", "3.10", "3.11", "3.12"]
# python = ["3.9"]


# Build configs
[tool.hatch.build.targets.sdist]
include = [
"src/**/*.py",
]


[build-system]
requires = ["hatchling", "hatch-regex-commit"]
build-backend = "hatchling.build"

0 comments on commit 65a1145

Please sign in to comment.