Skip to content

Commit 5072aaf

Browse files
committed
Initial commit
0 parents  commit 5072aaf

File tree

12 files changed

+361
-0
lines changed

12 files changed

+361
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
14+
env:
15+
SEAMLESS_VERSION_ONLY: true
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.x"
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build
28+
29+
- name: Build package
30+
run: python -m build
31+
32+
- name: Publish package
33+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
34+
with:
35+
user: __token__
36+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/python-test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test Python Package
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- dev/v\d+\.\d+\.\d+
8+
types: [opened, reopened, synchronize]
9+
paths:
10+
- 'src/**/*.py'
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.x"
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -r requirements.txt
29+
pip install -r tests/requirements.txt
30+
31+
- name: Run tests
32+
working-directory: ${{ github.workspace }}
33+
run: |
34+
python -m unittest discover -s tests -p 'test_*.py' -t ${{ github.workspace }}
35+
36+
- name: Run build test
37+
working-directory: ${{ github.workspace }}
38+
run: |
39+
python -m build

.gitignore

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110+
.pdm.toml
111+
.pdm-python
112+
.pdm-build/
113+
114+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115+
__pypackages__/
116+
117+
# Celery stuff
118+
celerybeat-schedule
119+
celerybeat.pid
120+
121+
# SageMath parsed files
122+
*.sage.py
123+
124+
# Environments
125+
.env
126+
.venv
127+
env/
128+
venv/
129+
ENV/
130+
env.bak/
131+
venv.bak/
132+
133+
# Spyder project settings
134+
.spyderproject
135+
.spyproject
136+
137+
# Rope project settings
138+
.ropeproject
139+
140+
# mkdocs documentation
141+
/site
142+
143+
# mypy
144+
.mypy_cache/
145+
.dmypy.json
146+
dmypy.json
147+
148+
# Pyre type checker
149+
.pyre/
150+
151+
# pytype static type analyzer
152+
.pytype/
153+
154+
# Cython debug symbols
155+
cython_debug/
156+
157+
# PyCharm
158+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160+
# and can be added to the global gitignore or merged into this file. For a more nuclear
161+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162+
#.idea/
163+
164+
.lh/
165+
_auto_html.py
166+
.vscode/

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# py-dotscript
2+
3+
Making Python simlper
4+
5+
## Installation
6+
7+
```shell
8+
pip install py-dotscript
9+
```
10+
11+
## Usage
12+
13+
```python
14+
import dotscript
15+
```
16+

pyproject.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[project]
2+
name = "py-dotscript"
3+
authors = [
4+
{ name="Xpo Development", email="[email protected]" },
5+
]
6+
description = "Making Python simlper"
7+
readme = "README.md"
8+
requires-python = ">=3.8"
9+
classifiers = [
10+
"Programming Language :: Python :: 3",
11+
"License :: OSI Approved :: MIT License",
12+
"Operating System :: OS Independent",
13+
]
14+
dynamic = ["dependencies", "version"]
15+
16+
[project.urls]
17+
Homepage = "https://github.com/xpodev/py-dotscript"
18+
Issues = "https://github.com/xpodev/py-dotscript/issues"
19+
20+
[build-system]
21+
requires = ["setuptools", "wheel"]
22+
build-backend = "setuptools.build_meta"
23+
24+
[tool.setuptools]
25+
package-dir = {"" = "src"}
26+
27+
[tool.setuptools.dynamic]
28+
version = {attr="dotscript.version.version"}
29+
dependencies = {file = ["requirements.txt"]}

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cssutils==2.9.0
2+
typing-extensions

src/dotscript/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from .version import version as __version__
2+
from .dot import
3+
4+
5+
__all__ = ["ᱹ", "__version__"]

src/dotscript/dot.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
class ᱹᱹᱹᱹᱹᱹᱹᱹᱹ(Exception):
2+
pass
3+
4+
class ᱹᱹᱹ:
5+
def __init__(ᱹᱹᱹᱹ, : "ᱹᱹ", ᱹᱹ: int, ᱹᱹᱹ: int):
6+
ᱹᱹᱹᱹ.__ᱹ__ =
7+
ᱹᱹᱹᱹ.__ᱹᱹ__ = ᱹᱹ
8+
ᱹᱹᱹᱹ.__ᱹᱹᱹ__ = ᱹᱹᱹ
9+
ᱹᱹᱹᱹ.__ᱹᱹᱹᱹᱹ__ = {}
10+
11+
def __getattr__(ᱹᱹᱹᱹ, ᱹᱹ: str):
12+
if ᱹᱹ in ᱹᱹᱹᱹ.__ᱹᱹᱹᱹᱹ__:
13+
. = ᱹᱹᱹᱹ.__ᱹᱹᱹᱹᱹ__[ᱹᱹ]
14+
return
15+
ᱹᱹᱹ = list(ᱹᱹ)
16+
if not all( == "ᱹ" for in ᱹᱹᱹ):
17+
raise ᱹᱹᱹᱹᱹᱹᱹᱹᱹ(f"I mean, this is dot script, right? So, why are you using this {} instead of ᱹ? This is very confusing.")
18+
ᱹᱹᱹ = ᱹᱹᱹᱹ.__ᱹᱹ__ + len(ᱹᱹᱹ) - 1
19+
if ᱹᱹᱹ > ᱹᱹᱹᱹ.__ᱹᱹᱹ__:
20+
raise ᱹᱹᱹᱹᱹᱹᱹᱹᱹ("You tried to access a value that is beyond your control. You might miscounted the number of ᱹ in your code.")
21+
ᱹᱹᱹᱹ.__ᱹᱹᱹᱹᱹ__[ᱹᱹ] = chr(ᱹᱹᱹ)
22+
. = chr(ᱹᱹᱹ)
23+
return
24+
25+
26+
27+
ᱹᱹᱹᱹᱹ = ""
28+
29+
class ᱹᱹ:
30+
def __init__(ᱹᱹᱹᱹ):
31+
global ᱹᱹᱹᱹᱹ
32+
ᱹᱹᱹᱹᱹ = ""
33+
ᱹᱹᱹᱹ.ᱹᱹ = ᱹᱹᱹ(ᱹᱹᱹᱹ, 97, 122); # a-z
34+
ᱹᱹᱹᱹ.ᱹᱹᱹ = ᱹᱹᱹ(ᱹᱹᱹᱹ, 65, 90); # A-Z
35+
ᱹᱹᱹᱹ.ᱹᱹᱹᱹ = ᱹᱹᱹ(ᱹᱹᱹᱹ, 48, 57); # 0-9
36+
ᱹᱹᱹᱹ.ᱹᱹᱹᱹᱹ = ᱹᱹᱹ(ᱹᱹᱹᱹ, 42, 47); # *+,-./
37+
ᱹᱹᱹᱹ.ᱹᱹᱹᱹᱹᱹ = ᱹᱹᱹ(ᱹᱹᱹᱹ, 32, 41); # !"#$%&'()
38+
ᱹᱹᱹᱹ.ᱹᱹᱹᱹᱹᱹᱹ = ᱹᱹᱹ(ᱹᱹᱹᱹ, 91, 96); # []^_`
39+
ᱹᱹᱹᱹ.ᱹᱹᱹᱹᱹᱹᱹᱹ = ᱹᱹᱹ(ᱹᱹᱹᱹ, 58, 64); # :;<=>?@
40+
ᱹᱹᱹᱹ.ᱹᱹᱹᱹᱹᱹᱹᱹᱹ = ᱹᱹᱹ(ᱹᱹᱹᱹ, 123, 126); # {|}~
41+
42+
@property
43+
def (ᱹᱹᱹᱹ):
44+
return ᱹᱹᱹᱹ.
45+
46+
@.setter
47+
def (ᱹᱹᱹᱹ, ):
48+
global ᱹᱹᱹᱹᱹ
49+
ᱹᱹᱹᱹᱹ +=
50+
51+
@.getter
52+
def (ᱹᱹᱹᱹ):
53+
eval(ᱹᱹᱹᱹᱹ)
54+
55+
@.deleter
56+
def (ᱹᱹᱹᱹ):
57+
raise AttributeError("ᱹᱹ.ᱹ is not deletable")
58+
59+
60+
= ᱹᱹ()

src/dotscript/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version = "0.1.0"

tests/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import sys
2+
import os
3+
4+
sys.path.append(os.path.join(os.path.dirname(__file__), '../src'))

0 commit comments

Comments
 (0)