Skip to content

Commit ba98999

Browse files
committed
Setup Readme and CI
1 parent db81985 commit ba98999

File tree

14 files changed

+373
-0
lines changed

14 files changed

+373
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: amrdeveloper
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps to reproduce the behavior:
14+
1. Go to '...'
15+
2. Click on '....'
16+
3. Scroll down to '....'
17+
4. See error
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Screenshots**
23+
If applicable, add screenshots to help explain your problem.
24+
25+
**GQL (please complete the following information):**
26+
- Version [e.g. 1.0.0]
27+
28+
**Additional context**
29+
Add any other context about the problem here.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen.
14+
15+
**Describe alternatives you've considered**
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
18+
**Additional context**
19+
Add any other context or screenshots about the feature request here.

.github/workflows/ci.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
fmt:
16+
name: Rustfmt
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dtolnay/rust-toolchain@stable
21+
- run: cargo fmt --all -- --check
22+
23+
clippy:
24+
name: Clippy
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: dtolnay/rust-toolchain@stable
29+
- run: cargo clippy -- -D warnings

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"rust-lang.rust-analyzer",
4+
]
5+
}

CODE_OF_CONDUCT.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
## Code of Conduct
2+
3+
### Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
### Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
### Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
### Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
### Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at amr96@programmer.net. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
### Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at [http://contributor-covenant.org/version/1/4][version]
72+
73+
[homepage]: http://contributor-covenant.org
74+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Contributing
2+
3+
Please provide issue report in the format that we request, EACH DETAIL IS A HUGE HELP.
4+
5+
Issues that are not following the guidelines,
6+
will be processed as last priority or never or simply closed as invalid.
7+
8+
## Contributing Guide
9+
10+
Please note that PRs are looked only for approved issues.

README.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<h1 align="center">PyQL - A Python Query Language</h1></br>
2+
3+
<p align="center">
4+
<img src="media/pyql_logo.svg" width="20%" height="20%"/>
5+
</p>
6+
7+
<p align="center">
8+
<img alt="Crates.io" src="https://img.shields.io/crates/v/pyql?style=flat-square">
9+
<img alt="Deps" src="https://deps.rs/repo/github/amrdeveloper/pyql/status.svg">
10+
<img alt="GitHub issues" src="https://img.shields.io/github/issues/amrdeveloper/pyql">
11+
<img alt="GitHub" src="https://img.shields.io/github/license/amrdeveloper/pyql">
12+
</p>
13+
14+
<p align="center">
15+
PyQL is a SQL like query language to run on Python source code files instead of database files using the GitQL SDK.
16+
</p>
17+
18+
<p align="center">
19+
<img src="media/pyql_demo.png" alt="animated" width="100%"/>
20+
</p>
21+
22+
---
23+
24+
### Tables structures
25+
26+
#### Functions table
27+
28+
| Name | Type | Description |
29+
| --------------- | ---------- | ---------------------------------------- |
30+
| function_name | Text | The name of Python function |
31+
| arguments_count | Integer | The number of arguments in this function |
32+
| function | PyFunction | A pointer to that Function Node in AST |
33+
| file_name | Text | File name that has this function |
34+
35+
36+
---
37+
38+
### Download or Install
39+
40+
- Install from Cargo.io
41+
42+
```
43+
cargo install pyql
44+
```
45+
46+
- Build from source code
47+
48+
```
49+
git clone https://github.com/AmrDeveloper/PyQL.git
50+
cd PyQL
51+
cargo build
52+
```
53+
54+
### Run PyQL
55+
56+
```
57+
PyQL is a SQL like query language to run on Python source code files
58+
Usage: PyQL [OPTIONS]
59+
60+
Options:
61+
-f, --files <paths> Path for local files to run query on
62+
-s, --script <file> Script file contains one or more query
63+
-q, --query <GQL Query> PyQL query to run on selected files
64+
-p, --pagination Enable print result with pagination
65+
-ps, --pagesize Set pagination page size [default: 10]
66+
-o, --output Set output format [render, json, csv]
67+
-a, --analysis Print Query analysis
68+
-e, --editor Enable GitQL LineEditor
69+
-h, --help Print PyQL help
70+
-v, --version Print PyQL Current Version
71+
```
72+
73+
### License
74+
75+
```
76+
MIT License
77+
78+
Copyright (c) 2024 Amr Hesham
79+
80+
Permission is hereby granted, free of charge, to any person obtaining a copy
81+
of this software and associated documentation files (the "Software"), to deal
82+
in the Software without restriction, including without limitation the rights
83+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
84+
copies of the Software, and to permit persons to whom the Software is
85+
furnished to do so, subject to the following conditions:
86+
87+
The above copyright notice and this permission notice shall be included in all
88+
copies or substantial portions of the Software.
89+
90+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
91+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
92+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
93+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
94+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
95+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
96+
SOFTWARE.
97+
```

RELEASING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Releasing GitQL Application
2+
3+
1. Update the `CHANGELOG.md`:
4+
2. Update `Cargo.toml` with the new version.
5+
6+
7+
3. Commit
8+
9+
```
10+
$ git commit -am "Prepare version X.Y.X"
11+
```
12+
13+
4. Tag
14+
15+
```
16+
$ git tag -am "X.Y.Z" X.Y.Z
17+
```
18+
19+
5. Push!
20+
21+
```
22+
$ git push && git push --tags
23+
```
24+
25+
This will trigger a GitHub Action workflow which will create a GitHub release and
26+
publish to Cargo.
27+
28+
# Releasing PyQL crate
29+
30+
1. Update `Cargo.toml` with the new version.
31+
2. `cargo publish --allow-dirty`

media/pyql_demo.png

576 KB
Loading

0 commit comments

Comments
 (0)