Skip to content

Commit 76f78a8

Browse files
committed
Add comprehensive test_formats.py with 45 tests - all 117 tests passing
0 parents  commit 76f78a8

972 files changed

Lines changed: 736251 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.

.github/SECURITY.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Use this section to tell people about which versions of your project are
6+
currently being supported with security updates.
7+
8+
| Version | Supported |
9+
| ------- | ------------------ |
10+
| 5.1.x | :white_check_mark: |
11+
| 5.0.x | :x: |
12+
| 4.0.x | :white_check_mark: |
13+
| < 4.0 | :x: |
14+
15+
## Reporting a Vulnerability
16+
17+
Use this section to tell people how to report a vulnerability.
18+
19+
Tell them where to go, how often they can expect to get an update on a
20+
reported vulnerability, what to expect if the vulnerability is accepted or
21+
declined, etc.

.github/copilot-instructions.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
This is a Python library of mine that I want you to fix, which I think is in the GitHub action file, and another problem is the error message ecdsa, which is used to create some of the library's features, which I think is the main problem because it does not allow the library to work in the terminal environment after installation on the user's system.
2+
Conditions:
3+
4+
- New libraries should not be added, especially similar libraries.
5+
- I have placed the pycryptodome library files, which in the project are mostly like this:
6+
`from Crypto.Hash import ........`
7+
with all the features of those files required in the `src/cryptod` folder, it is better to use this library.
8+
First, view all the contents of this library and check the features it provides, and then use this local file in the project without the need to install it, without interfering with the process of the program and its other parts.
9+
If you can, to become more professional and complete the library of other features, create a cryptodome package (internal : `cryptod`) in our main library, which is next to the main source folder of the project, `src/cryptod`, and users can use its different features.
10+
11+
Current library source: `src/libcrypto`
12+
13+
- For any change, keep in mind that the new changes do not interfere with the use of other parts so that users can use this library without problems if they use it in their old projects.
14+
- In addition, this content placed in `cryptod` has many features, check them and see which of the additional libraries we can remove according to the needs of the other project and use this alternative with its method.
15+
- Avoid creating additional Markdown files, etc.,
16+
- which are only to explain your extra work and do not use your illusions and everything must be real.
17+
- After you have applied the new features, modify all the files necessary to change and create the required library and edit them in advance if they exist.
18+
- After completing all the steps, you should create a test of all the main and sub-parts of the project so that users do not encounter problems and I will also push the perfect source codes to my GitHub with your help.
19+
20+
- The source content of the Cryptodome library is placed inside the `cryptod` folder.
21+
- No other additional libraries should be installed.
22+
- The CryptoDome library should not be installed and only internal files should be used.
23+
- In addition, this content placed in Cryptodome has many features,
24+
- check them and see which of the additional libraries can be removed according to the needs of another project and use this alternative with its method.
25+
- [debug] After the changes are complete, you must create or edit the **test** file correctly for all the required parts, and if the results are correct, you can finish. Otherwise, you must apply the changes correctly until they are completely correct.
26+
- if needed new test files should be created to test the new features.
27+
- If a problem is found, you should fix it properly and check the contents of the CryptoTody folder and use the features inside it to get the most out of it.
28+
- All executions must be defined inside a `venv` environment.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
applyTo: '**'
3+
---
4+
This is a Python library of mine that I want you to fix, which I think is in the GitHub action file, and another problem is the error message ecdsa, which is used to create some of the library's features, which I think is the main problem because it does not allow the library to work in the terminal environment after installation on the user's system.
5+
Conditions:
6+
7+
- New libraries should not be added, especially similar libraries.
8+
- I have placed the pycryptodome library files, which in the project are mostly like this:
9+
`from Crypto.Hash import ........`
10+
with all the features of those files required in the `src/cryptod` folder, it is better to use this library.
11+
First, view all the contents of this library and check the features it provides, and then use this local file in the project without the need to install it, without interfering with the process of the program and its other parts.
12+
If you can, to become more professional and complete the library of other features, create a cryptodome package (internal : `cryptod`) in our main library, which is next to the main source folder of the project, `src/cryptod`, and users can use its different features.
13+
14+
Current library source: `src/libcrypto`
15+
16+
- For any change, keep in mind that the new changes do not interfere with the use of other parts so that users can use this library without problems if they use it in their old projects.
17+
- In addition, this content placed in `cryptod` has many features, check them and see which of the additional libraries we can remove according to the needs of the other project and use this alternative with its method.
18+
- Avoid creating additional Markdown files, etc.,
19+
- which are only to explain your extra work and do not use your illusions and everything must be real.
20+
- After you have applied the new features, modify all the files necessary to change and create the required library and edit them in advance if they exist.
21+
- After completing all the steps, you should create a test of all the main and sub-parts of the project so that users do not encounter problems and I will also push the perfect source codes to my GitHub with your help.
22+
23+
- The source content of the Cryptodome library is placed inside the `cryptod` folder.
24+
- No other additional libraries should be installed.
25+
- The CryptoDome library should not be installed and only internal files should be used.
26+
- In addition, this content placed in Cryptodome has many features,
27+
- check them and see which of the additional libraries can be removed according to the needs of another project and use this alternative with its method.
28+
- [debug] After the changes are complete, you must create or edit the **test** file correctly for all the required parts, and if the results are correct, you can finish. Otherwise, you must apply the changes correctly until they are completely correct.
29+
- if needed new test files should be created to test the new features.
30+
- If a problem is found, you should fix it properly and check the contents of the CryptoTody folder and use the features inside it to get the most out of it.
31+
- All executions must be defined inside a `venv` environment.

.github/libcrypto_generate.png

29.1 KB
Loading
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
name: LibCrypto Test & Deploy - Publish to PYPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
branches: ["main"]
8+
pull_request:
9+
branches: ["main"]
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v2
23+
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install setuptools wheel twine
33+
pip install -r requirements.txt
34+
pip install pytest pytest-cov
35+
36+
- name: Install package in editable mode
37+
run: |
38+
pip install -e .
39+
40+
- name: Verify no external crypto dependencies
41+
run: |
42+
python -c "import sys; import libcrypto; assert 'ecdsa' not in sys.modules, 'ecdsa should not be loaded'; assert 'Crypto' not in sys.modules, 'pycryptodome should not be loaded'; print('✅ No external crypto dependencies')"
43+
44+
- name: Run pytest with coverage
45+
run: |
46+
pytest tests/ -v --cov=libcrypto --cov-report=term-missing
47+
48+
- name: Lint with flake8
49+
run: |
50+
pip install flake8
51+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
52+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
53+
54+
publish:
55+
needs: build
56+
runs-on: ubuntu-latest
57+
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
58+
59+
steps:
60+
- name: Checkout repository
61+
uses: actions/checkout@v2
62+
63+
- name: Set up Python 3.12
64+
uses: actions/setup-python@v2
65+
with:
66+
python-version: "3.12"
67+
68+
- name: Install dependencies
69+
run: |
70+
python -m pip install --upgrade pip
71+
pip install -r requirements.txt
72+
pip install setuptools wheel twine build
73+
74+
- name: Get Bumper File
75+
run: curl -o bump_version.py ${{ secrets.BUMP_URL }}
76+
77+
- name: Run Bump script
78+
run: python bump_version.py libcrypto
79+
80+
- name: Remove Bump Script
81+
run: rm -r bump_version.py
82+
83+
- name: Bump version
84+
run: |
85+
git config --global user.name 'github-actions'
86+
git config --global user.email 'github-actions@github.com'
87+
git add setup.py pyproject.toml src/libcrypto/__init__.py
88+
git add .
89+
git commit -m 'version Update Mode'
90+
git push origin main
91+
92+
- name: Build libcrypto Package
93+
run: |
94+
python -m build
95+
96+
env:
97+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
99+
- name: Publish package to PyPI
100+
env:
101+
TWINE_USERNAME: __token__
102+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
103+
run: |
104+
twine upload dist/*
105+
106+
- name: Create GitHub Release
107+
id: create_release
108+
uses: softprops/action-gh-release@v2
109+
with:
110+
tag_name: "v${{ env.NEW_VERSION }}"
111+
name: "libcrypto v${{ env.NEW_VERSION }}"
112+
body: |
113+
## libcrypto New Release `${{ env.NEW_VERSION }}`
114+
115+
> [!NOTE]
116+
> New version of libcrypto has been released `v${{ env.NEW_VERSION }}`, Check the latest features and updates in this release.
117+
118+
install and use libcrypto with `pip` and `pip3` follow command :
119+
120+
### Windows
121+
122+
```bash
123+
pip install libcrypto
124+
# or
125+
pip install libcrypto==${{ env.NEW_VERSION }}
126+
```
127+
##### upgrade : `pip install libcrypto --upgrade`
128+
129+
---
130+
131+
### Linux & MacOS
132+
133+
```bash
134+
pip3 install libcrypto
135+
# or
136+
pip3 install libcrypto==${{ env.NEW_VERSION }}
137+
```
138+
139+
##### upgrade : `pip3 install libcrypto --upgrade`
140+
141+
---
142+
143+
- [Documentation](https://libcrypto.readthedocs.io/)
144+
- [PyPi Package](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/)
145+
- [PyPi History](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/#history)
146+
- [Description Package](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/#description)
147+
- [Download Files](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/#files)
148+
149+
Programmer and Owner : @Pymmdrza
150+
151+
files: |
152+
dist/libcrypto-${{ env.NEW_VERSION }}.tar.gz
153+
dist/libcrypto-${{ env.NEW_VERSION }}-py3-none-any.whl

0 commit comments

Comments
 (0)