Skip to content

Commit f877f37

Browse files
hiddifygithub-actions[bot]
hiddify
authored andcommitted
✅ Ready to clone and code.
1 parent efd41fa commit f877f37

16 files changed

+50
-51
lines changed

.github/rename_project.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ echo "Description: $description";
1616

1717
echo "Renaming project..."
1818

19-
original_author="author_name"
20-
original_name="project_name"
21-
original_urlname="project_urlname"
22-
original_description="project_description"
19+
original_author="hiddify"
20+
original_name="xtlsapi"
21+
original_urlname="xtlsapi"
22+
original_description="Awesome xtlsapi created by hiddify"
2323
# for filename in $(find . -name "*.*")
2424
for filename in $(git ls-files)
2525
do
@@ -30,7 +30,7 @@ do
3030
echo "Renamed $filename"
3131
done
3232

33-
mv project_name $name
33+
mv xtlsapi $name
3434

3535
# This command runs only once on GHA!
3636
rm -rf .github/template.yml

.github/template.yml

-1
This file was deleted.

ABOUT_THIS_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Lets take a look at the structure of this template:
3232
├── Makefile # A collection of utilities to manage the project
3333
├── MANIFEST.in # A list of files to include in a package
3434
├── mkdocs.yml # Configuration for documentation site
35-
├── project_name # The main python package for the project
35+
├── xtlsapi # The main python package for the project
3636
│   ├── base.py # The base module for the project
3737
│   ├── __init__.py # This tells Python that this is a package
3838
│   ├── __main__.py # The entry point for the project
@@ -109,7 +109,7 @@ I had to do some tricks to read that version variable inside the setuptools
109109
I decided to keep the version in a static file because it is easier to read from
110110
wherever I want without the need to install the package.
111111

112-
e.g: `cat project_name/VERSION` will get the project version without harming
112+
e.g: `cat xtlsapi/VERSION` will get the project version without harming
113113
with module imports or anything else, it is useful for CI, logs and debugging.
114114

115115
### Why to include `tests`, `history` and `Containerfile` as part of the release?

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# How to develop on this project
22

3-
project_name welcomes contributions from the community.
3+
xtlsapi welcomes contributions from the community.
44

55
**You need PYTHON3!**
66

77
This instructions are for linux base systems. (Linux, MacOS, BSD, etc.)
88
## Setting up your own fork of this repo.
99

1010
- On github interface click on `Fork` button.
11-
- Clone your fork of this repo. `git clone [email protected]:YOUR_GIT_USERNAME/project_urlname.git`
12-
- Enter the directory `cd project_urlname`
13-
- Add upstream repo `git remote add upstream https://github.com/author_name/project_urlname`
11+
- Clone your fork of this repo. `git clone [email protected]:YOUR_GIT_USERNAME/xtlsapi.git`
12+
- Enter the directory `cd xtlsapi`
13+
- Add upstream repo `git remote add upstream https://github.com/hiddify/xtlsapi`
1414

1515
## Setting up your own virtual environment
1616

Containerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ FROM python:3.7-alpine
22
COPY . /app
33
WORKDIR /app
44
RUN pip install .
5-
CMD ["project_name"]
5+
CMD ["xtlsapi"]

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ include LICENSE
22
include HISTORY.md
33
include Containerfile
44
graft tests
5-
graft project_name
5+
graft xtlsapi

Makefile

+10-10
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ install: ## Install the project in dev mode.
2626

2727
.PHONY: fmt
2828
fmt: ## Format code using black & isort.
29-
$(ENV_PREFIX)isort project_name/
30-
$(ENV_PREFIX)black -l 79 project_name/
29+
$(ENV_PREFIX)isort xtlsapi/
30+
$(ENV_PREFIX)black -l 79 xtlsapi/
3131
$(ENV_PREFIX)black -l 79 tests/
3232

3333
.PHONY: lint
3434
lint: ## Run pep8, black, mypy linters.
35-
$(ENV_PREFIX)flake8 project_name/
36-
$(ENV_PREFIX)black -l 79 --check project_name/
35+
$(ENV_PREFIX)flake8 xtlsapi/
36+
$(ENV_PREFIX)black -l 79 --check xtlsapi/
3737
$(ENV_PREFIX)black -l 79 --check tests/
38-
$(ENV_PREFIX)mypy --ignore-missing-imports project_name/
38+
$(ENV_PREFIX)mypy --ignore-missing-imports xtlsapi/
3939

4040
.PHONY: test
4141
test: lint ## Run tests and generate coverage report.
42-
$(ENV_PREFIX)pytest -v --cov-config .coveragerc --cov=project_name -l --tb=short --maxfail=1 tests/
42+
$(ENV_PREFIX)pytest -v --cov-config .coveragerc --cov=xtlsapi -l --tb=short --maxfail=1 tests/
4343
$(ENV_PREFIX)coverage xml
4444
$(ENV_PREFIX)coverage html
4545

@@ -78,9 +78,9 @@ virtualenv: ## Create a virtual environment.
7878
release: ## Create a new tag for release.
7979
@echo "WARNING: This operation will create s version tag and push to github"
8080
@read -p "Version? (provide the next x.y.z semver) : " TAG
81-
@echo "$${TAG}" > project_name/VERSION
81+
@echo "$${TAG}" > xtlsapi/VERSION
8282
@$(ENV_PREFIX)gitchangelog > HISTORY.md
83-
@git add project_name/VERSION HISTORY.md
83+
@git add xtlsapi/VERSION HISTORY.md
8484
@git commit -m "release: version $${TAG} 🚀"
8585
@echo "creating git tag : $${TAG}"
8686
@git tag $${TAG}
@@ -101,15 +101,15 @@ switch-to-poetry: ## Switch to poetry package manager.
101101
@poetry init --no-interaction --name=a_flask_test --author=rochacbruno
102102
@echo "" >> pyproject.toml
103103
@echo "[tool.poetry.scripts]" >> pyproject.toml
104-
@echo "project_name = 'project_name.__main__:main'" >> pyproject.toml
104+
@echo "xtlsapi = 'xtlsapi.__main__:main'" >> pyproject.toml
105105
@cat requirements.txt | while read in; do poetry add --no-interaction "$${in}"; done
106106
@cat requirements-test.txt | while read in; do poetry add --no-interaction "$${in}" --dev; done
107107
@poetry install --no-interaction
108108
@mkdir -p .github/backup
109109
@mv requirements* .github/backup
110110
@mv setup.py .github/backup
111111
@echo "You have switched to https://python-poetry.org/ package manager."
112-
@echo "Please run 'poetry shell' or 'poetry run project_name'"
112+
@echo "Please run 'poetry shell' or 'poetry run xtlsapi'"
113113

114114
.PHONY: init
115115
init: ## Initialize the project based on an application template.

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ See also
4040
- ✅ Code linting using [flake8](https://flake8.pycqa.org/en/latest/)
4141
- 📊 Code coverage reports using [codecov](https://about.codecov.io/sign-up/)
4242
- 🛳️ Automatic release to [PyPI](https://pypi.org) using [twine](https://twine.readthedocs.io/en/latest/) and github actions.
43-
- 🎯 Entry points to execute your program using `python -m <project_name>` or `$ project_name` with basic CLI argument parsing.
43+
- 🎯 Entry points to execute your program using `python -m <xtlsapi>` or `$ xtlsapi` with basic CLI argument parsing.
4444
- 🔄 Continuous integration using [Github Actions](.github/workflows/) with jobs to lint, test and release your project on Linux, Mac and Windows environments.
4545

4646
> Curious about architectural decisions on this template? read [ABOUT_THIS_TEMPLATE.md](ABOUT_THIS_TEMPLATE.md)
@@ -51,33 +51,33 @@ See also
5151
<!-- DELETE THE LINES ABOVE THIS AND WRITE YOUR PROJECT README BELOW -->
5252

5353
---
54-
# project_name
54+
# xtlsapi
5555

56-
[![codecov](https://codecov.io/gh/author_name/project_urlname/branch/main/graph/badge.svg?token=project_urlname_token_here)](https://codecov.io/gh/author_name/project_urlname)
57-
[![CI](https://github.com/author_name/project_urlname/actions/workflows/main.yml/badge.svg)](https://github.com/author_name/project_urlname/actions/workflows/main.yml)
56+
[![codecov](https://codecov.io/gh/hiddify/xtlsapi/branch/main/graph/badge.svg?token=xtlsapi_token_here)](https://codecov.io/gh/hiddify/xtlsapi)
57+
[![CI](https://github.com/hiddify/xtlsapi/actions/workflows/main.yml/badge.svg)](https://github.com/hiddify/xtlsapi/actions/workflows/main.yml)
5858

59-
project_description
59+
Awesome xtlsapi created by hiddify
6060

6161
## Install it from PyPI
6262

6363
```bash
64-
pip install project_name
64+
pip install xtlsapi
6565
```
6666

6767
## Usage
6868

6969
```py
70-
from project_name import BaseClass
71-
from project_name import base_function
70+
from xtlsapi import BaseClass
71+
from xtlsapi import base_function
7272

7373
BaseClass().base_method()
7474
base_function()
7575
```
7676

7777
```bash
78-
$ python -m project_name
78+
$ python -m xtlsapi
7979
#or
80-
$ project_name
80+
$ xtlsapi
8181
```
8282

8383
## Development

mkdocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
site_name: project_name
1+
site_name: xtlsapi
22
theme: readthedocs

setup.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
"""Python setup.py for project_name package"""
1+
"""Python setup.py for xtlsapi package"""
22
import io
33
import os
44
from setuptools import find_packages, setup
55

66

77
def read(*paths, **kwargs):
88
"""Read the contents of a text file safely.
9-
>>> read("project_name", "VERSION")
9+
>>> read("xtlsapi", "VERSION")
1010
'0.1.0'
1111
>>> read("README.md")
1212
...
@@ -30,17 +30,17 @@ def read_requirements(path):
3030

3131

3232
setup(
33-
name="project_name",
34-
version=read("project_name", "VERSION"),
35-
description="project_description",
36-
url="https://github.com/author_name/project_urlname/",
33+
name="xtlsapi",
34+
version=read("xtlsapi", "VERSION"),
35+
description="Awesome xtlsapi created by hiddify",
36+
url="https://github.com/hiddify/xtlsapi/",
3737
long_description=read("README.md"),
3838
long_description_content_type="text/markdown",
39-
author="author_name",
39+
author="hiddify",
4040
packages=find_packages(exclude=["tests", ".github"]),
4141
install_requires=read_requirements("requirements.txt"),
4242
entry_points={
43-
"console_scripts": ["project_name = project_name.__main__:main"]
43+
"console_scripts": ["xtlsapi = xtlsapi.__main__:main"]
4444
},
4545
extras_require={"test": read_requirements("requirements-test.txt")},
4646
)

tests/test_base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from project_name.base import NAME
1+
from xtlsapi.base import NAME
22

33

44
def test_base():
5-
assert NAME == "project_name"
5+
assert NAME == "xtlsapi"
File renamed without changes.
File renamed without changes.

project_name/__main__.py renamed to xtlsapi/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Entry point for project_name."""
1+
"""Entry point for xtlsapi."""
22

33
from .cli import main # pragma: no cover
44

project_name/base.py renamed to xtlsapi/base.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
project_name base module.
2+
xtlsapi base module.
33
4-
This is the principal module of the project_name project.
4+
This is the principal module of the xtlsapi project.
55
here you put your main classes and objects.
66
77
Be creative! do whatever you want!
@@ -14,4 +14,4 @@
1414
"""
1515

1616
# example constant variable
17-
NAME = "project_name"
17+
NAME = "xtlsapi"

project_name/cli.py renamed to xtlsapi/cli.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""CLI interface for project_name project.
1+
"""CLI interface for xtlsapi project.
22
33
Be creative! do whatever you want!
44
@@ -12,7 +12,7 @@
1212
def main(): # pragma: no cover
1313
"""
1414
The main function executes on commands:
15-
`python -m project_name` and `$ project_name `.
15+
`python -m xtlsapi` and `$ xtlsapi `.
1616
1717
This is your program's entry point.
1818

0 commit comments

Comments
 (0)