Skip to content

Commit 092b5f6

Browse files
Merge pull request #2 from Cat-Treat/feat/cip67-cip68
Feat/cip67 cip68
2 parents 2df945e + fed24ba commit 092b5f6

File tree

127 files changed

+14582
-2172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+14582
-2172
lines changed

.github/workflows/main.yml

+27-10
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: "**"
66
pull_request:
7-
branches: ["main"]
7+
branches: ["main", "chang"]
88
types: [opened, reopened, edited, synchronize]
99

1010
jobs:
@@ -14,29 +14,34 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ubuntu-latest, macos-latest]
17-
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
17+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
1818

1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
- name: Install poetry
2222
run: pipx install poetry
2323
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v4
24+
uses: actions/setup-python@v5
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727
cache: 'poetry'
2828
- name: Install dependencies
2929
run: |
3030
poetry install
31+
- name: Ensure pure cbor2 is installed
32+
run: |
33+
make ensure-pure-cbor2
3134
- name: Run unit tests
3235
run: |
3336
poetry run pytest --doctest-modules --ignore=examples --cov=pycardano --cov-config=.coveragerc --cov-report=xml
3437
- name: "Upload coverage to Codecov"
3538
if: ${{ matrix.python-version == '3.11' }}
36-
uses: codecov/codecov-action@v3
39+
uses: codecov/codecov-action@v4
3740
with:
38-
fail_ci_if_error: true
41+
fail_ci_if_error: false
42+
token: ${{ secrets.CODECOV_TOKEN || '' }}
3943
- name: Run static analyses
44+
if: ${{ matrix.python-version == '3.11' }}
4045
run: |
4146
make qa
4247
@@ -48,27 +53,39 @@ jobs:
4853
python-version: ['3.11']
4954

5055
steps:
51-
- uses: actions/checkout@v3
56+
- uses: actions/checkout@v4
5257
- name: Install poetry
5358
run: pipx install poetry
5459
- name: Set up Python ${{ matrix.python-version }}
55-
uses: actions/setup-python@v4
60+
uses: actions/setup-python@v5
5661
with:
5762
python-version: ${{ matrix.python-version }}
5863
cache: 'poetry'
5964

65+
- name: Setup docker-compose
66+
uses: KengoTODA/[email protected]
67+
with:
68+
version: '2.14.2'
69+
6070
- name: Run integration tests
6171
run: |
6272
cd integration-test && ./run_tests.sh
6373
74+
- name: "Upload coverage to Codecov"
75+
if: ${{ matrix.python-version == '3.11' }}
76+
uses: codecov/codecov-action@v4
77+
with:
78+
fail_ci_if_error: false
79+
token: ${{ secrets.CODECOV_TOKEN || '' }}
80+
6481
- name: Dump docker logs
6582
if: failure()
6683
run: |
67-
cd integration-test && docker-compose logs --no-color > integration-test.log
84+
cd integration-test && docker compose logs --no-color > integration-test.log
6885
6986
- name: Upload integration-test.log
7087
if: failure()
71-
uses: actions/upload-artifact@v2
88+
uses: actions/upload-artifact@v4
7289
with:
7390
name: integration-test.log
7491
path: integration-test/integration-test.log

.github/workflows/publish.yml

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
poetry install
27+
- name: Ensure pure cbor2 is installed
28+
run: |
29+
make ensure-pure-cbor2
2730
- name: Lint with flake8
2831
run: |
2932
poetry run flake8 pycardano

.gitignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
cov_html
44
docs/build
55
dist
6+
.mypy_cache
7+
coverage.xml
8+
.cbor2_version
69

710
# IDE
811
.idea
9-
.code
12+
.code
13+
/integration-test/.env
14+
/integration-test/tmp_configs/*
15+
/integration-test/.coverage*

Makefile

+23-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,25 @@ export PRINT_HELP_PYSCRIPT
2323

2424
BROWSER := poetry run python -c "$$BROWSER_PYSCRIPT"
2525

26+
ensure-pure-cbor2: ## ensures cbor2 is installed with pure Python implementation
27+
@poetry run python -c "from importlib.metadata import version; \
28+
print(version('cbor2'))" > .cbor2_version
29+
@poetry run python -c "import cbor2, inspect; \
30+
print('Checking cbor2 implementation...'); \
31+
decoder_path = inspect.getfile(cbor2.CBORDecoder); \
32+
using_c_ext = decoder_path.endswith('.so'); \
33+
print(f'Implementation path: {decoder_path}'); \
34+
print(f'Using C extension: {using_c_ext}'); \
35+
exit(1 if using_c_ext else 0)" || \
36+
(echo "Reinstalling cbor2 with pure Python implementation..." && \
37+
poetry run pip uninstall -y cbor2 && \
38+
CBOR2_BUILD_C_EXTENSION=0 poetry run pip install --no-binary cbor2 "cbor2==$$(cat .cbor2_version)" --force-reinstall && \
39+
rm .cbor2_version)
40+
2641
help:
2742
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
2843

29-
cov: ## check code coverage
44+
cov: ensure-pure-cbor2 ## check code coverage
3045
poetry run pytest -n 4 --cov pycardano
3146

3247
cov-html: cov ## check code coverage and generate an html report
@@ -54,13 +69,16 @@ clean-test: ## remove test and coverage artifacts
5469
rm -fr cov_html/
5570
rm -fr .pytest_cache
5671

57-
test: ## runs tests
58-
poetry run pytest -s -vv -n 4
72+
test: ensure-pure-cbor2 ## runs tests
73+
poetry run pytest -vv -n 4
74+
75+
test-integration: ## runs integration tests
76+
cd integration-test && ./run_tests.sh
5977

6078
test-single: ## runs tests with "single" markers
6179
poetry run pytest -s -vv -m single
6280

63-
qa: ## runs static analyses
81+
qa: ensure-pure-cbor2 ## runs static analyses
6482
poetry run flake8 pycardano
6583
poetry run mypy --install-types --non-interactive pycardano
6684
poetry run black --check .
@@ -75,6 +93,6 @@ docs: ## build the documentation
7593
poetry run sphinx-build docs/source docs/build/html
7694
$(BROWSER) docs/build/html/index.html
7795

78-
release: clean qa test format ## build dist version and release to pypi
96+
release: clean qa test format ensure-pure-cbor2 ## build dist version and release to pypi
7997
poetry build
8098
poetry publish

README.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ https://pycardano.readthedocs.io/en/latest/
6666

6767
A full stack testnet DApp is hosted on replit: https://pycardano.cffls.repl.co/
6868

69-
To learn more details, go to the [DApp page](https://github.com/cffls/pycardano/tree/main/examples/full_stack).
69+
To learn more details, go to the [DApp page](https://github.com/Python-Cardano/pycardano/tree/main/examples/full_stack).
7070

7171
#### Transaction creation and signing
7272

@@ -254,10 +254,5 @@ You can support us by 1) sponsoring through Github, or 2) donating ADA to our AD
254254
## Sponsors :heart:
255255

256256
<p align="left">
257-
<a href="https://github.com/KtorZ"><img src="https://avatars.githubusercontent.com/u/5680256?s=50&v=4"/></a>
258-
<a href="https://github.com/CardanoDur"><img width="50" src="https://avatars.githubusercontent.com/u/1000466?s=50&v=4"/></a>
259-
<a href="https://github.com/huths0lo"><img width="50" src="https://avatars.githubusercontent.com/u/78839856?s=50&v=4"/></a>
260-
<a href="https://github.com/markrufino"><img width="50" src="https://avatars.githubusercontent.com/u/30117352?v=4"/></a>
261-
<a href="https://github.com/OpShin"><img width="50" src="https://avatars.githubusercontent.com/u/102762047?s=200&v=4"/></a>
262-
<a href="https://github.com/aada-finance"><img width="50" src="https://avatars.githubusercontent.com/u/89693711?v=4"/></a>
257+
<a href="https://github.com/blockfrost"><img src="https://avatars.githubusercontent.com/u/70073210?s=50&v=4"/></a>
263258
</p>

0 commit comments

Comments
 (0)