Closed kloczek closed 3 years ago
Looks like in project root there is no factory_boy directory. Probably renama factory to factory_boy could solve that issue (but I'm not sure).
Thanks for the report!
Indeed, it might be confusing: factory_boy uses the factory_boy
distribution name, but installs the factory
package.
However, I'm surprised at the way you're trying to build the doc: we use make doc
to that end (which ends up calling sphinx-build
with the right flags)
Thanks for the report!
Indeed, it might be confusing: factory_boy uses the
factory_boy
distribution name, but installs thefactory
package.However, I'm surprised at the way you're trying to build the doc: we use
make doc
to that end (which ends up callingsphinx-build
with the right flags)
That is how I'm generating man pages for all my rpm packages with python mopduules and that way should be somehow supported as factory_boy source tree is using setuptools 😋 It is all about using some standards 🤪
That's indeed interesting; do you have some pointer to the docs of that entrypoint / CLI? It's the first time I hear about it, so I don't know where to start looking to comply to said standards :/
That way is build-in in setuptools
module.
Just try to execute python setup.py --help-commands
in your project root directory to see full set of setuptools commands
It's actually provided by Sphinx: https://www.sphinx-doc.org/en/master/usage/advanced/setuptools.html
However, I see no issue running the command locally:
$ python -m venv venv
$ . ./venv/bin/activate
$ pip install -e .[dev,doc]
# ...
$ python setup.py build_sphinx -b man
running build_sphinx
...
Writing... factoryboy.1 { introduction reference orms recipes fuzzy examples internals changelog credits ideas } done
build succeeded.
The manual pages are in build/sphinx/man.
As a side note, how do you setup your work environment? The factory/__init__.py
file expects the package to be installed in the current environment, that's why we start with a pip install --editable .
.
All what is needed is run egg_info
before bnuild documentation (yes that is equivalent of the p install -e .
which is simpletr and lighter than using pip).
With that it builds correctly:
+ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx
running build_sphinx
Running Sphinx v4.1.2
making output directory... done
loading intersphinx inventory from https://docs.python.org/objects.inv...
loading intersphinx inventory from https://docs.djangoproject.com/en/dev/_objects/...
loading intersphinx inventory from https://docs.sqlalchemy.org/en/latest/objects.inv...
intersphinx inventory has moved: https://docs.python.org/objects.inv -> https://docs.python.org/3/objects.inv
intersphinx inventory has moved: https://docs.sqlalchemy.org/en/latest/objects.inv -> https://docs.sqlalchemy.org/en/14/objects.inv
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 11 added, 0 changed, 0 removed
reading sources... [100%] reference
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-factory-boy.3 { introduction reference orms recipes fuzzy examples internals changelog credits ideas } done
build succeeded.
The manual pages are in build/sphinx/man.
Closing
Oh, that's a nice fix, thanks for letting us know how you fixed it!
BTW you can change: https://github.com/FactoryBoy/factory_boy/commit/00bd29292bd99aca4b8659bece464ed30c200c22#diff-7b3ed02bc73dc06b7db906cf97aa91dec2b2eb21f2d92bc5caa761df5bbc168fR442-R443 tu just:
python setup.py egg_info make_sphinx -b <output_format>
With that Makefile is not needed :)
Looks like in copy.py is missing path to
factory_boy
module code.