Skip to content

Commit d6eec0d

Browse files
authored
Create wheel with version number not "main" (#79)
1 parent c47439c commit d6eec0d

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

.github/workflows/workflow.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
create:
88
tags:
99
- '*'
10+
11+
env:
12+
FORCE_COLOR: 1
13+
1014
jobs:
1115
check:
1216
runs-on: ubuntu-latest
@@ -31,6 +35,8 @@ jobs:
3135
runs-on: ubuntu-latest
3236
steps:
3337
- uses: actions/checkout@v3
38+
with:
39+
fetch-depth: 0
3440
- name: Set up Python
3541
uses: actions/setup-python@v4
3642
with:
@@ -95,7 +101,7 @@ jobs:
95101
path: dist
96102
- name: Install downloaded wheel
97103
run: |
98-
python -m pip install dist/sphinxext_opengraph-main-py3-none-any.whl
104+
python -m pip install --no-index --find-links=dist sphinxext-opengraph
99105
- name: Run tests for ${{ matrix.python-version }}
100106
run: |
101107
python -m pytest -vv

setup.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
1-
import subprocess
2-
31
import setuptools
42

5-
# This will fail if something happens or if not in a git repository.
6-
# This is intentional.
7-
try:
8-
ret = subprocess.run(
9-
"git describe --tags --abbrev=0",
10-
capture_output=True,
11-
check=True,
12-
shell=True,
13-
)
14-
version = ret.stdout.decode("utf-8").strip()
15-
except:
16-
version = "main"
17-
183
with open("README.md", encoding="utf-8") as readme:
194
long_description = readme.read()
205

216
setuptools.setup(
227
name="sphinxext-opengraph",
23-
version=version,
8+
use_scm_version=True,
9+
setup_requires=["setuptools_scm"],
2410
author="Itay Ziv",
2511
author_email="[email protected]",
2612
description="Sphinx Extension to enable OGP support",

0 commit comments

Comments
 (0)