Skip to content

Commit 6aca675

Browse files
committed
switch to using setuptools_scm to get version
also turn off local_scheme because we're testing uploads to TestPyPI, and pypi does not support it.
1 parent 1658fe3 commit 6aca675

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
python-version: '3.x'
2020
- name: Install dependencies
2121
run: |
22-
pip install setuptools
22+
pip install setuptools setuptools_scm
2323
- name: Build package
2424
env:
2525
VERSION: ${{ github.event.release.tag_name }}

setup.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import os
21
import re
3-
import subprocess
42

53
import sdist_upip
64
from setuptools import setup
@@ -19,17 +17,11 @@ def long_desc_from_readme():
1917
return long_description
2018

2119

22-
def get_version():
23-
version = os.environ.get('VERSION', None)
24-
if not version:
25-
version = subprocess.check_output(['git', 'describe', '--always', '--tags', '--dirty'])
26-
version = str(version, 'utf-8').strip()
27-
return version
28-
29-
3020
setup(
3121
name="micropython-py-esp32-ulp",
32-
version=get_version(),
22+
use_scm_version={
23+
'local_scheme': 'no-local-version',
24+
},
3325
description="Assembler toolchain for the ESP32 ULP co-processor, written in MicroPython",
3426
long_description=long_desc_from_readme(),
3527
long_description_content_type='text/x-rst',
@@ -43,6 +35,7 @@ def get_version():
4335
'License :: OSI Approved :: MIT License',
4436
'Programming Language :: Python :: Implementation :: MicroPython',
4537
],
38+
setup_requires=['setuptools_scm'],
4639
platforms=["esp32", "linux", "darwin"],
4740
cmdclass={"sdist": sdist_upip.sdist},
4841
packages=["esp32_ulp"],

0 commit comments

Comments
 (0)