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

Get python versions from setup.py? #310

Closed
endolith opened this issue Jan 15, 2020 · 4 comments
Closed

Get python versions from setup.py? #310

endolith opened this issue Jan 15, 2020 · 4 comments

Comments

@endolith
Copy link
Contributor

Is it possible for python-package.yml to automatically get the python versions from setup.py → python_requires='>=3.6'?

@SumanaShree53
Copy link

from html.parser import HTMLParser
from urllib.request import urlopen
from urllib import parse
class LinkParser(HTMLParser):
def handle_starttag(self,tag,attrs):
if tag=='a':
for(key,value)in attrs:
if key=='href':
newurl=parse.urljoin(self.baseurl,value)
self.links=self.links+[newurl]
def getLinks(self,url):
self.links=[]
self.baseUrl=url
response=urlopen(url)
if response.getheader('Content-type')=='text/html':
htmlBytes=response.read()
htmlString=htmlBytes.decode("utf-8")
self.feed(htmlString)
return htmlString,self.links
else:
return" ",[]
def spider(url,word,maxPages):
pagesToVisit=[url]
numberVisited=0
foundWord=False
while numberVisited<maxPages and pagesToVisit !=[] and not foundWord : numberVisited=numberVisited+1
url pagesToVisit[0]
pagesToVisit=pagesToVisit[1:]
try:
print(numberVisited,"visiting:",url)
parser=LinkParser()
data,Links=parser.getLinks(url)
if data.find(word)>-1:
foundWord=True
pagesToVisit=pagestoVisit+links
print("success")
except:
print("Failed")
if foundWord:
print("The Word",word,"was found at",url)
else:
print("word never found")

@yritetaas
Copy link

@yritetaas
Copy link

#310 (comment)

@konradpabjan
Copy link
Collaborator

An update was rolled out the actions/setup-python that now causes the version of Python that was setup to be displayed, and outputted so it can be used in the YAML

See: actions/setup-python#51 and actions/setup-python#50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants