Skip to content

Commit

Permalink
Create wheel with version number not "main" (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Oct 31, 2022
1 parent c47439c commit d6eec0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/workflow.yml
Expand Up @@ -7,6 +7,10 @@ on:
create:
tags:
- '*'

env:
FORCE_COLOR: 1

jobs:
check:
runs-on: ubuntu-latest
Expand All @@ -31,6 +35,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -95,7 +101,7 @@ jobs:
path: dist
- name: Install downloaded wheel
run: |
python -m pip install dist/sphinxext_opengraph-main-py3-none-any.whl
python -m pip install --no-index --find-links=dist sphinxext-opengraph
- name: Run tests for ${{ matrix.python-version }}
run: |
python -m pytest -vv
Expand Down
18 changes: 2 additions & 16 deletions setup.py
@@ -1,26 +1,12 @@
import subprocess

import setuptools

# This will fail if something happens or if not in a git repository.
# This is intentional.
try:
ret = subprocess.run(
"git describe --tags --abbrev=0",
capture_output=True,
check=True,
shell=True,
)
version = ret.stdout.decode("utf-8").strip()
except:
version = "main"

with open("README.md", encoding="utf-8") as readme:
long_description = readme.read()

setuptools.setup(
name="sphinxext-opengraph",
version=version,
use_scm_version=True,
setup_requires=["setuptools_scm"],
author="Itay Ziv",
author_email="itay220204@gmail.com",
description="Sphinx Extension to enable OGP support",
Expand Down

0 comments on commit d6eec0d

Please sign in to comment.