Skip to content

Commit cb11899

Browse files
committed
Updates tests and workflows
1 parent 3fd871f commit cb11899

File tree

4 files changed

+45
-14
lines changed

4 files changed

+45
-14
lines changed

.github/workflows/tests.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ on:
99
pull_request:
1010

1111
jobs:
12-
build:
12+
tests:
1313

1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
17+
python-version: [ "3.11", "3.12", "3.13", "3.14" ]
1818

1919
steps:
2020
- uses: actions/checkout@v2
@@ -30,3 +30,31 @@ jobs:
3030
- name: Test with pytest
3131
run: |
3232
poetry run pytest
33+
34+
release:
35+
needs: [ tests ]
36+
if: success() && startsWith(github.ref, 'refs/tags/')
37+
runs-on: ubuntu-24.04
38+
environment: release
39+
40+
permissions:
41+
contents: read
42+
id-token: write
43+
44+
steps:
45+
- uses: actions/checkout@v5
46+
47+
- uses: actions/setup-python@v5
48+
with:
49+
python-version: '3.11'
50+
51+
- uses: snok/install-poetry@v1
52+
with:
53+
virtualenvs-create: true
54+
virtualenvs-in-project: true
55+
installer-parallel: true
56+
57+
- name: Build
58+
run: poetry build
59+
60+
- uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pytailwindcss"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
description = "Standalone Tailwind CSS CLI, installable via pip. Use Tailwind CSS without Node.js."
55
authors = ["Tim Kamanin <tim@timonweb.com>"]
66
homepage = "https://github.com/timonweb/pytailwindcss"
@@ -11,9 +11,10 @@ classifiers = [
1111
"Development Status :: 4 - Beta",
1212
"Intended Audience :: Developers",
1313
"License :: OSI Approved :: MIT License",
14-
"Programming Language :: Python :: 3.8",
15-
"Programming Language :: Python :: 3.9",
16-
"Programming Language :: Python :: 3.10",
14+
"Programming Language :: Python :: 3.11",
15+
"Programming Language :: Python :: 3.12",
16+
"Programming Language :: Python :: 3.13",
17+
"Programming Language :: Python :: 3.14",
1718
"Operating System :: OS Independent",
1819
"Topic :: Software Development :: Libraries",
1920
"Topic :: Utilities",
@@ -29,11 +30,11 @@ tailwindcss = "pytailwindcss.__main__:main"
2930
tailwindcss_install = "pytailwindcss.__main__:install"
3031

3132
[tool.poetry.dependencies]
32-
python = "^3.8"
33+
python = "^3.11"
3334

3435
[tool.poetry.dev-dependencies]
35-
pytest = "^7.4.0"
36-
pre-commit = "^3.3.0"
36+
pytest = "^8.4.2"
37+
pre-commit = "^4.3.0"
3738

3839
[build-system]
3940
requires = ["poetry-core>=1.0.0"]

tests/test_core.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,24 @@
99

1010
def test_successful_run():
1111
"""
12-
It installs the executable and successfully runs a build command.
12+
It installs the executable and successfully runs the CLI.
1313
"""
1414
with clean_dir(get_bin_path()):
1515
pytailwindcss.install()
16-
assert "MIT License | https://tailwindcss.com" in pytailwindcss.run("build")
16+
output = pytailwindcss.run("--help")
17+
assert "tailwindcss" in output.lower()
1718

1819

1920
def test_successful_run_from_custom_bin_path():
2021
"""
21-
It installs the executable and successfully runs a build command.
22+
It installs the executable and successfully runs the CLI from a custom path.
2223
"""
2324
ALTERNATIVE_BIN_PATH = "/tmp/test-bin/tailwindcss"
2425

2526
with clean_dir(ALTERNATIVE_BIN_PATH):
2627
pytailwindcss.install(bin_path=ALTERNATIVE_BIN_PATH)
27-
assert "MIT License | https://tailwindcss.com" in pytailwindcss.run("build", bin_path=ALTERNATIVE_BIN_PATH)
28+
output = pytailwindcss.run("--help", bin_path=ALTERNATIVE_BIN_PATH)
29+
assert "tailwindcss" in output.lower()
2830

2931

3032
def test_unsuccessful_run():

tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_make_subprocess_run_kwargs():
2121
assert make_subprocess_run_kwargs(cwd=None)["cwd"] == os.getcwd()
2222
assert make_subprocess_run_kwargs(cwd="/tmp")["cwd"] == "/tmp"
2323

24-
assert make_subprocess_run_kwargs(env=None)["env"] == {}
24+
assert make_subprocess_run_kwargs(env=None)["env"] is None
2525
assert make_subprocess_run_kwargs(env={"TAILWINDCSS_VERSION": "v3.0.7"})["env"] == {
2626
"TAILWINDCSS_VERSION": "v3.0.7"
2727
}

0 commit comments

Comments
 (0)