Skip to content

Commit d71eeee

Browse files
upload to pypi
1 parent 52bca01 commit d71eeee

File tree

7 files changed

+83
-12
lines changed

7 files changed

+83
-12
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
create-release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Extract version from tag
21+
id: get_version
22+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
23+
24+
- name: Generate release notes
25+
id: generate_notes
26+
uses: mikepenz/release-changelog-builder-action@v3
27+
with:
28+
configuration: ".github/changelog-config.json"
29+
commitMode: true
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Create Release
34+
uses: softprops/action-gh-release@v1
35+
with:
36+
name: "LeetCLI v${{ env.VERSION }}"
37+
body: ${{ steps.generate_notes.outputs.changelog }}
38+
draft: false
39+
prerelease: false
40+
generate_release_notes: ${{ steps.generate_notes.outputs.changelog == '' }}
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ TODO.md
22
__pycache__
33
.venv
44
leetcode_cli.egg-info
5-
*.cpp
5+
leetcli.egg-info
6+
*.cpp
7+
*.mkv
8+
dist

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A sleek command-line tool for LeetCode - solve, test, and submit problems direct
1111
#### 1. Using pip
1212

1313
```bash
14-
pip install leetcode-cli
14+
pip install leetcli
1515
```
1616

1717
#### 2. clone the repository

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ requests
33
gql[all]
44
bs4
55
setuptools
6-
markdownify
6+
markdownify
7+
twine

setup.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
11
from setuptools import find_packages, setup
22

33
setup(
4-
name="leetcode-cli",
5-
version="0.1.0",
4+
name="leetcli",
5+
version="0.0.1",
6+
author="Yuvrajsinh5252",
7+
author_email="yuvrajsinh476@gmail.com",
8+
description="A sleek command-line tool for LeetCode platform",
9+
long_description=open("README.md").read(),
10+
long_description_content_type="text/markdown",
11+
url="https://github.com/yuvrajsinh5252/leetcode-cli",
612
packages=find_packages(),
13+
install_requires=[
14+
"setuptools",
15+
"typer",
16+
"requests",
17+
"gql[all]",
18+
"bs4",
19+
"markdownify",
20+
"rich",
21+
],
22+
classifiers=[
23+
"Programming Language :: Python :: 3",
24+
"Operating System :: OS Independent",
25+
],
26+
python_requires=">=3.6",
727
entry_points={
828
"console_scripts": [
929
"lc=src.main:main",

src/commands/edit.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,20 @@ def create_file_with_template(lang: str):
9292
"Try ':set ft=markdown' to at least get syntax highlighting."
9393
)
9494
elif editor == "code" or editor == "code-insiders":
95-
subprocess.run([editor, "--goto", code_file_path])
96-
subprocess.run([editor, markdown_file])
9795
try:
9896
subprocess.run(
99-
[editor, "--command", "markdown.showPreview"],
97+
[
98+
editor,
99+
"--goto",
100+
code_file_path,
101+
markdown_file,
102+
"--command",
103+
"markdown.showPreviewToSide",
104+
],
100105
stderr=subprocess.DEVNULL,
101106
)
102-
except Exception:
103-
pass
107+
except Exception as e:
108+
typer.echo(f"Failed to open VS Code with markdown preview: {str(e)}")
104109
elif editor == "nano":
105110
typer.echo(
106111
"Note: Nano doesn't support split view or markdown preview. Opening code file only."

src/lib/solution_ui.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class SolutionUI:
2626
"author": "yellow",
2727
"date": "cyan",
2828
"stats": "blue",
29-
"tags": "white on blue",
29+
"tags": "cyan",
3030
"table_border": "blue",
3131
}
3232

@@ -100,7 +100,7 @@ def _format_tags(self, tags):
100100
tag_display = self._truncate_text(tag_name, 10)
101101

102102
formatted_tags.append(
103-
f"[{self.STYLES['tags']}]{escape(tag_display)}[/{self.STYLES['tags']}]"
103+
f"[{self.STYLES['tags']}]#{escape(tag_display)}[/{self.STYLES['tags']}]"
104104
)
105105

106106
return " ".join(formatted_tags)

0 commit comments

Comments
 (0)