read version from lib
This commit is contained in:
		
							parent
							
								
									b41eb58ca3
								
							
						
					
					
						commit
						6e823beec8
					
				
					 2 changed files with 14 additions and 4 deletions
				
			
		| 
						 | 
					@ -1,3 +1,5 @@
 | 
				
			||||||
 | 
					__version__ == '0.1.2'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from .LTS import *
 | 
					from .LTS import *
 | 
				
			||||||
from .USBdev import *
 | 
					from .USBdev import *
 | 
				
			||||||
from .interactive import *
 | 
					from .interactive import *
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										16
									
								
								setup.py
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								setup.py
									
										
									
									
									
								
							| 
						 | 
					@ -1,16 +1,24 @@
 | 
				
			||||||
#!/usr/bin/env python
 | 
					#!/usr/bin/env python
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import os
 | 
				
			||||||
 | 
					import re
 | 
				
			||||||
from setuptools import setup, find_packages
 | 
					from setuptools import setup, find_packages
 | 
				
			||||||
from os import path
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Function to read the requirements from the requirements.txt file
 | 
					def read_version():
 | 
				
			||||||
 | 
					    with open(os.path.join(os.path.dirname(__file__), 'labhw', '__init__.py')) as f:
 | 
				
			||||||
 | 
					        for line in f:
 | 
				
			||||||
 | 
					            match = re.match(r"^__version__ = ['\"]([^'\"]*)['\"]", line)
 | 
				
			||||||
 | 
					            if match:
 | 
				
			||||||
 | 
					                return match.group(1)
 | 
				
			||||||
 | 
					        raise RuntimeError("Unable to find version string.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def parse_requirements(filename):
 | 
					def parse_requirements(filename):
 | 
				
			||||||
	with open(filename, 'r') as file:
 | 
						with open(filename, 'r') as file:
 | 
				
			||||||
		return file.read().splitlines()
 | 
							return file.read().splitlines()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Get the long description from the README file
 | 
					# Get the long description from the README file
 | 
				
			||||||
here = path.abspath(path.dirname(__file__))
 | 
					here = os.path.abspath(os.path.dirname(__file__))
 | 
				
			||||||
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
 | 
					with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
 | 
				
			||||||
	long_description = f.read()
 | 
						long_description = f.read()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue