Skip to content

Commit

Permalink
[update] fix std duration
Browse files Browse the repository at this point in the history
  • Loading branch information
StardustDL committed Feb 5, 2024
1 parent 69da66b commit 55f3b7f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 30 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# AexPy Package Index

Scheduled data processing tasks for [online AexPy](https://aexpy.netlify.app/).
63 changes: 33 additions & 30 deletions index/std.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from aexpy.environments.conda import CondaEnvironment, CondaEnvironmentBuilder
from aexpy.extracting.environment import getExtractorEnvironmentBuilder
from aexpy.models import Release, ReleasePair, ApiDescription
from aexpy import utils

from index.dist import DistPathBuilder
from index.processor import ProcessDB
Expand Down Expand Up @@ -87,41 +88,43 @@ def version(self, release):
totalResult: ApiDescription | None = None
totalLog = ""

for module in modules:
env.logger.info(f"Process stdlib: {module}")
result = self.worker.preprocess(
[
"-s",
str(rootPath),
"-p",
str(release),
"-P",
release.version,
"-m",
module,
"-",
],
check=True,
)
result = self.worker.extract(
["-", "-", "-e", e.name], input=result.out
)
totalLog += result.log

if result.data is None:
continue

if totalResult is None:
totalResult = result.data
else:
for entry in result.data.entries.values():
if entry.id not in totalResult.entries:
totalResult.addEntry(entry)
with utils.elapsedTimer() as timer:
for module in modules:
env.logger.info(f"Process stdlib: {module}")
result = self.worker.preprocess(
[
"-s",
str(rootPath),
"-p",
str(release),
"-P",
release.version,
"-m",
module,
"-",
],
check=True,
)
result = self.worker.extract(
["-", "-", "-e", e.name], input=result.out
)
totalLog += result.log

if result.data is None:
continue

if totalResult is None:
totalResult = result.data
else:
for entry in result.data.entries.values():
if entry.id not in totalResult.entries:
totalResult.addEntry(entry)
if totalResult is None:
finalResult = AexPyResult(
code=1, log="Failed to dump", out=""
)
else:
totalResult.duration = timer()
finalResult = AexPyResult(
out=totalResult.model_dump_json(), log=totalLog, code=0
)
Expand Down

0 comments on commit 55f3b7f

Please sign in to comment.