Skip to content

Commit

Permalink
Merge pull request #3 from ccpgames/fix/everything_is_broken
Browse files Browse the repository at this point in the history
## [5.1.1] - 2024-06-28
  • Loading branch information
CCP-Zeulix authored Jun 28, 2024
2 parents 6cbd3a5 + 0772c26 commit de6d063
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [5.1.1] - 2024-06-28

### Fixed

- An issue where the `__everything__.py` file was missing the first character of
the package name if the build root ended with a slash (or backslash)


## [5.1.0] - 2024-04-30

### Added
Expand Down
2 changes: 1 addition & 1 deletion neobuilder/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '5.1.0'
__version__ = '5.1.1'
8 changes: 6 additions & 2 deletions neobuilder/neobuilder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from grpc_tools import protoc
from . import render
import pathlib

from ccptools.tpu import strimp

Expand Down Expand Up @@ -387,11 +388,14 @@ def add_everything(self):

line_buffer = []

broot = pathlib.Path(self.build_root).absolute()

for (dirpath, dirnames, filenames) in os.walk(self.build_path):
for f in filenames:
if f.endswith('.py') and not f.endswith('__.py'):
fpath = os.path.join(dirpath, f).replace('\\', '/')
package_name = fpath[len(self.build_root)+1:-3].replace('/', '.')
fpath = pathlib.Path(dirpath) / f
rel_path = fpath.relative_to(broot)
package_name = str(rel_path)[:-3].replace('\\', '/').replace('/', '.')
line_buffer.append(f'import {package_name}')
counter += 1
line_buffer.sort()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
HERE = os.path.dirname(__file__)

PROTO_ROOT = os.path.join(HERE, 'res', 'proto')
BUILD_ROOT = os.path.join(HERE, 'res', 'build')
BUILD_ROOT = os.path.join(HERE, 'res', 'build/')


class ServiceTest(unittest.TestCase):
Expand Down

0 comments on commit de6d063

Please sign in to comment.