Skip to content

Commit

Permalink
setuptools_scm (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
prisae authored Oct 28, 2022
1 parent abe414d commit 0ed857f
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 17 deletions.
8 changes: 0 additions & 8 deletions .bumpversion.cfg

This file was deleted.

8 changes: 7 additions & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ jobs:
python-version: [3.7, 3.8, 3.9, "3.10"]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 100
persist-credentials: false
- name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 100
persist-credentials: false
- name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*'
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install setuptools setuptools_scm wheel twine
- name: Build and Install Wheel
run: |
python setup.py bdist_wheel
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*.egg-info/
build/
dist/
scooby/version.py

# Mac
.DS_Store
Expand Down
15 changes: 13 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
include *.rst LICENSE
include README.md
prune assets
prune tests
prune .github
exclude codecov.yml
exclude Makefile
exclude MANIFEST.in
exclude pyproject.toml
exclude requirements_style.txt
exclude requirements_test.txt
exclude requirements.txt
exclude .flake8
exclude .gitignore
exclude .pre-commit-config.yaml
7 changes: 6 additions & 1 deletion scooby/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@
__author__ = 'Dieter Werthmüller, Bane Sullivan, Alex Kaszynski, and contributors'
__license__ = 'MIT'
__copyright__ = '2019, Dieter Werthmüller & Bane Sullivan'
__version__ = '0.7.dev0'
try:
from scooby.version import version as __version__
except ImportError: # Only happens if not properly installed.
from datetime import datetime

__version__ = 'unknown-' + datetime.today().strftime('%Y%m%d')
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# coding=utf-8
import io
import os

import setuptools

__version__ = '0.7.dev0'

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

setuptools.setup(
name="scooby",
version=__version__,
author="Dieter Werthmüller, Bane Sullivan, Alex Kaszynski, and contributors",
author_email="[email protected]",
description="A Great Dane turned Python environment detective",
Expand All @@ -30,4 +28,10 @@
'cpu': ['psutil', 'mkl'],
# 'gpu': [], # TODO: what's needed?
},
use_scm_version={
"root": ".",
"relative_to": __file__,
"write_to": os.path.join("scooby", "version.py"),
},
setup_requires=["setuptools_scm"],
)

0 comments on commit 0ed857f

Please sign in to comment.