Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create wheel with version number not "main" #79

Merged
merged 4 commits into from Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions .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 @@ -65,7 +71,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11-dev', 'pypy3.8']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy3.8']
sphinx-version: ['>=4,<5', '>=5,<6', '>=6a0,<7']
os: [windows-latest, macos-latest, ubuntu-latest]
exclude:
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