Skip to content

Commit

Permalink
Merge pull request #136 from kevinheavey/installation-fix
Browse files Browse the repository at this point in the history
Fix bare installation issues
  • Loading branch information
kevinheavey authored Feb 12, 2024
2 parents 4e6fae3 + 8df19b0 commit 42ea185
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.19.0
current_version = 0.19.1
commit = True
tag = True
tag_name = {new_version}
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/check_optional_deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Dependency check
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
dep_check:
name: dep_check
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9

#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#----------------------------------------------
# install your root project
#----------------------------------------------
- name: install library
run: poetry install --only main

- name: Check import
run: poetry run python -c "from anchorpy import Program"
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [0.19.1] - 2024-02-12

### Fixed

- Fix anchorpy import when no extras are included [#(136)](https://github.com/kevinheavey/anchorpy/pull/136)

## [0.19.0] - 2024-02-12

### Added
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "anchorpy"
version = "0.19.0"
version = "0.19.1"
description = "The Python Anchor client."
readme = "README.md"
repository = "https://github.com/kevinheavey/anchorpy"
Expand Down Expand Up @@ -111,6 +111,7 @@ target-version = "py310"
convention = "google"

[tool.ruff.per-file-ignores]
"src/anchorpy/__init__.py" = ["F401"]
"src/anchorpy/coder/*.py" = ["ARG002"]
"src/anchorpy/borsh_extension.py" = ["ARG002"]
"tests/**/*.py" = ["ARG001", "E501"]
Expand Down
30 changes: 24 additions & 6 deletions src/anchorpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""The Python Anchor client."""
from contextlib import suppress as __suppress

from anchorpy_core.idl import Idl

from anchorpy import error, utils
Expand All @@ -16,20 +18,26 @@
from anchorpy.program.namespace.account import AccountClient, ProgramAccount
from anchorpy.program.namespace.simulate import SimulateResponse
from anchorpy.provider import Provider, Wallet
from anchorpy.pytest_plugin import bankrun_fixture, localnet_fixture, workspace_fixture
from anchorpy.workspace import WorkspaceType, close_workspace, create_workspace

__all__ = [
__has_pytest = False
with __suppress(ImportError):
from anchorpy.pytest_plugin import (
bankrun_fixture,
localnet_fixture,
workspace_fixture,
)

__has_pytest = True

__all_core = [
"Program",
"Provider",
"Context",
"bankrun_fixture",
"create_workspace",
"close_workspace",
"Idl",
"workspace_fixture",
"WorkspaceType",
"localnet_fixture",
"Wallet",
"Coder",
"InstructionCoder",
Expand All @@ -48,5 +56,15 @@
"utils",
]

__all__ = (
[
*__all_core,
"bankrun_fixture",
"localnet_fixture",
"workspace_fixture",
]
if __has_pytest
else __all_core
)

__version__ = "0.19.0"
__version__ = "0.19.1"

0 comments on commit 42ea185

Please sign in to comment.