๋ฏธ๋ ๋ฒ์ : 0.16.0
ํ์ด์ฌ ๋ฒ์ : 3.5
future.moves
๋๋ future.backports
ํจํค์ง๋ฅผ ๊ฐ์ ธ์ฌ ๋ ์ด๋ฆ๋ณ๋ก ๋ค์ํ ๋ชจ๋ ์ ๊ฐ์ ธ์ค๋ ค๊ณ ์๋ํ๋ import_top_level_modules()
๋ฅผ ํธ์ถํฉ๋๋ค. ์๋ฅผ ๋ค์ด ์ฌ์ฉ์ ํ๋ก์ ํธ์ test.py
๊ฐ ์๋ ๊ฒฝ์ฐ์๋ ์๊ธฐ์น ์๊ฒ ๊ฐ์ ธ์ต๋๋ค.
์์๋ ์ปค๋ฐ 264f9bcdf0์ ๋ฉ์์ง์ ๋ฐ๋ฅด๋ฉด "ํ
์คํธ ๋ฌ๋๊ฐ Py3์ travis-ci์์ ์์
ํ๊ฒ ํ๊ธฐ import_top_level_modules()
๋ฉ์๋๊ฐ ๋์
๋์์ต๋๋ค.
์ด ์ฝ๋๋ฅผ ํ
์คํธ ํจํค์ง์ ๋ฐฐ์นํ๋ ๊ฒ์ด ์ข์ง ์์๊น์?
์ด๊ฒ์ ๋ฌผ๋ฆฐ ๊ฒ๋ฟ์
๋๋ค.
https://bitbucket.org/pyglet/pyglet/issues/117/pyglet-produces-spurious-imports
์ด๊ฒ์ ๋ํ ์ด๋ค ์ ๋ฐ์ดํธ?
๋๋ python3๊ณผ ํจ๊ป apache_beam์ ์ฌ์ฉํ ๋ ์ด๊ฒ์ ๋ฌผ๋ ธ์ต๋๋ค.
์ฌํํ๋ ค๋ฉด:
echo "raise NotImplementedError('This test.py file should not be touched')" >> ./test.py
pip install apache_beam
python -c "import apache_beam as beam"
import_top_level_modules
์์ ํธ์ถ๋๋ exclude_local_folder_imports
๋ํ ์ฃผ์์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
(This was need prior to v0.16.0 because the presence of a configparser
folder would otherwise have prevented setuptools from running on Py3. Maybe
it's not needed any more?)
๊ทธ๊ฒ ์์ด๋ ์ ์๋ํ๋ ๊ฒ ๊ฐ์ต๋๋ค. ์๋ง๋ ์๊ฐ์ ๋๋ค.
๋ํ ์ด ํจํค์ง์ ์์กดํ๋ ๋์ ํ๋กํ
๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ๋ ๋์ ๋ฌผ๋ ธ์ต๋๋ค. ๊ฐ๋ฐ ์ค์ ํจํค์ง๋ฅผ ์คํํ๊ธฐ ์ํด ๋น ๋ฅด๊ณ ๋๋ฌ์ด test.py
๊ฐ ๋ฐ์ํ๊ธฐ ๋๋ฌธ์ ๋งค์ฐ ์ด์ํ ๋์์ด ๋ฐ์ํ์ต๋๋ค. ์ด๋ ๋ก์ปฌ ํ
์คํธ๋ฅผ ์ํํ ๋๋ง๋ค ์คํ ์ค์ด๊ณ ์๋์ผ๋ก ์ค์ํ ์ํ๋ฅผ ๋ณ๊ฒฝํ๋ ๊ฒ์ผ๋ก ๋ํ๋ฌ์ต๋๋ค. ๋ด ์ฑ์. ๋๋ ์ด๋ฐ ์กฐ์ฉํ ๋ฌธ์ ๋ฅผ ๋๋ฒ๊น
ํ๋ ๊ฒ์ ์ ๋ง ์ซ์ดํฉ๋๋ค. ์ด ๋์์ ์ ๊ฑฐํ๋ ๊ฒ์ ์ฐ์ ์ ์ผ๋ก ๊ณ ๋ คํ์ญ์์ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋๋ python3๊ณผ ํจ๊ป apache_beam์ ์ฌ์ฉํ ๋ ์ด๊ฒ์ ๋ฌผ๋ ธ์ต๋๋ค.
์ฌํํ๋ ค๋ฉด:
import_top_level_modules
์์ ํธ์ถ๋๋exclude_local_folder_imports
๋ํ ์ฃผ์์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.๊ทธ๊ฒ ์์ด๋ ์ ์๋ํ๋ ๊ฒ ๊ฐ์ต๋๋ค. ์๋ง๋ ์๊ฐ์ ๋๋ค.