Skip to content

Commit a16902e

Browse files
author
1
committed
switch to pyproject
1 parent 673ba6f commit a16902e

8 files changed

Lines changed: 498 additions & 471 deletions

File tree

.github/workflows/python-app.yml

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,38 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
41
name: Awesome xonshrc test
52

63
on:
74
push:
8-
branches: [ main ]
5+
branches: [main]
96
pull_request:
10-
branches: [ main ]
7+
branches: [main]
118

129
jobs:
1310
build:
14-
1511
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.11", "3.12", "3.13", "3.14"]
1615

1716
steps:
18-
- uses: actions/checkout@v2
19-
- name: Set up Python 3
20-
uses: actions/setup-python@v2
21-
with:
22-
python-version: 3.12
23-
- name: Install dependencies
24-
run: |
25-
echo $(python -V)
26-
python -m pip install --upgrade pip
27-
pip install 'xonsh[full]'
28-
- name: Install awesome RC
29-
run: |
30-
pip install --use-pep517 .
31-
- name: Test awesome RC
32-
run: |
33-
echo Get xontrib name
34-
filename=$(basename -- $(ls xontrib/*.*))
35-
xontrib_name="${filename%.*}"
36-
echo Xontrib name: $xontrib_name
37-
echo Testing...
38-
export XONSH_SHOW_TRACEBACK=True
39-
xonsh -c "xontrib load $xontrib_name"
40-
#r=$(xonsh -c "xontrib load $xontrib_name" 2>&1 || true)
41-
#echo Test output: $r
42-
#[ "$r" == "" ] && exit 0 || exit 1
17+
- uses: actions/checkout@v4
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
echo $(python -V)
25+
python -m pip install --upgrade pip
26+
pip install 'xonsh[full]'
27+
- name: Install awesome RC
28+
run: |
29+
pip install .
30+
- name: Test awesome RC
31+
run: |
32+
echo Get xontrib name
33+
filename=$(basename -- $(ls xontrib/*.*))
34+
xontrib_name="${filename%.*}"
35+
echo Xontrib name: $xontrib_name
36+
echo Testing...
37+
export XONSH_SHOW_TRACEBACK=True
38+
xonsh -c "xontrib load $xontrib_name"

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# Distribution / packaging
7+
build/
8+
dist/
9+
*.egg-info/
10+
*.egg
11+
12+
# Virtual environments
13+
.venv/
14+
venv/
15+
16+
# IDEs
17+
.idea/
18+
.vscode/
19+
*.swp
20+
*.swo
21+
*~
22+
23+
# OS
24+
.DS_Store
25+
Thumbs.db

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) anki-code
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Learn about xonsh run control (RC) files in official docs - [Run Control File](h
1616

1717
1. Fork this repository
1818
2. Rename the repository to `xontrib-rc-yourname`
19-
3. Change the name [in setup.py](https://github.com/anki-code/xontrib-rc-awesome/blob/e21370c1155262b8e25bd354cb4d4f9f15945384/setup.py#L11)
19+
3. Change the name in `pyproject.toml` (`[project]``name`)
2020
4. Change the name of `xontrib/rc_awesome.xsh` to `xontrib/rc_yourname.xsh`
21-
5. [Add xontribs you need to setup.py](https://github.com/anki-code/xontrib-rc-awesome/blob/495dce4c8e7e8c9882ea002db60935d03f3fb861/setup.py#L20-L38) (the xontribs will be installed automatically during `pip install`)
21+
5. Add xontribs you need to `pyproject.toml` (`[project]``dependencies`) — they will be installed automatically during `pip install`
2222
6. Now you can just run anywhere:
2323
```xonsh
2424
pip install -U git+https://github.com/yourname/xontrib-rc-yourname
@@ -35,7 +35,7 @@ Learn about xonsh run control (RC) files in official docs - [Run Control File](h
3535
```
3636
Also you can avoid manual loading the xontrib in `~/.xonshrc` by creating autoloadable xontrib using [xontrib-template](https://github.com/xonsh/xontrib-template). Answer yes on the question about enabling autoloading.
3737

38-
7. [Increment version](https://github.com/anki-code/xontrib-rc-awesome/blob/df5c0aa3e29325f5d926cec7022cd2ccc184c0c5/setup.py#L12) to update the package using `pip install -U git+https://github.com/yourname/xontrib-rc-yourname`
38+
7. Increment `version` in `pyproject.toml` to update the package using `pip install -U git+https://github.com/yourname/xontrib-rc-yourname`
3939

4040
8. Take a look into [xonsh-awesome-cli-app](https://github.com/anki-code/xonsh-awesome-cli-app) if you want to create your own toolset.
4141

@@ -48,7 +48,7 @@ Or add awesome xonsh RC to the end of your [xonshrc](https://xon.sh/xonshrc.html
4848
curl -s https://raw.githubusercontent.com/anki-code/xontrib-rc-awesome/main/xontrib/rc_awesome.xsh >> ~/.xonshrc
4949
```
5050
51-
Or install awesome [xonsh RC as a package](https://github.com/anki-code/xontrib-rc-awesome/blob/fabe895fbdd89f7bd3050bf492aa0665624a9705/setup.py#L10-L16) with [automatically installable xontribs](https://github.com/anki-code/xontrib-rc-awesome/blob/fabe895fbdd89f7bd3050bf492aa0665624a9705/setup.py#L20-L30):
51+
Or install awesome xonsh RC as a package with automatically installable xontribs:
5252
```xonsh
5353
pip install -U git+https://github.com/anki-code/xontrib-rc-awesome
5454
echo 'xontrib load rc_awesome' >> ~/.xonshrc

pyproject.toml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.backends._legacy:_Backend"
4+
5+
[project]
6+
name = "xontrib-rc-awesome"
7+
version = "0.15.2"
8+
description = "Awesome snippets of code for xonshrc in xonsh shell."
9+
readme = "README.md"
10+
license = "MIT"
11+
requires-python = ">=3.11"
12+
authors = [
13+
{ name = "anki-code", email = "no@no.no" },
14+
]
15+
dependencies = [
16+
"xonsh[full]",
17+
"xontrib-spec-mod",
18+
"xontrib-prompt-bar",
19+
"xontrib-back2dir",
20+
"xontrib-sh",
21+
"xontrib-pipeliner",
22+
"xontrib-output-search",
23+
"xontrib-argcomplete",
24+
"xontrib-cmd-durations",
25+
"xontrib-jedi",
26+
"xontrib-jump-to-dir",
27+
"xontrib-clp",
28+
]
29+
30+
[project.optional-dependencies]
31+
xxh = ["xxh-xxh"]
32+
33+
[project.urls]
34+
Homepage = "https://github.com/anki-code/xontrib-rc-awesome"
35+
Repository = "https://github.com/anki-code/xontrib-rc-awesome"
36+
37+
[tool.setuptools]
38+
packages = ["xontrib"]
39+
40+
[tool.setuptools.package-data]
41+
xontrib = ["*.py", "*.xsh"]

requirements.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)