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

Remove hardcoded copyright year #3616

Merged
merged 4 commits into from Feb 16, 2018

Conversation

@stsewd
Copy link
Member

@stsewd stsewd commented Feb 15, 2018

No description provided.

@@ -10,7 +14,7 @@ source_parsers = {
}
master_doc = 'index'
project = u'{{ project.name }}'
copyright = u'2016'
copyright = datetime.now().year
Copy link
Member Author

@stsewd stsewd Feb 15, 2018

Is this expected to be a string somewhere?

Copy link
Member Author

@stsewd stsewd Feb 15, 2018

Looks like yes!

Copy link
Member Author

@stsewd stsewd Feb 15, 2018

Interesting that all the tests pass but this simple change breaks all the builds p:

docs/conf.py Outdated
@@ -33,7 +36,9 @@

master_doc = 'index'
project = u'Read the Docs'
copyright = u'2010-2017, Read the Docs, Inc & contributors'
copyright = '2010-{}, Read the Docs, Inc & contributors'.format(
datetime.now().year
Copy link
Member

@safwanrahman safwanrahman Feb 15, 2018

Instead of using python datetime, use django timezone. It have timezone aware time.

Copy link
Member

@humitos humitos Feb 15, 2018

I think we don't depends on Django for building the RTD documentation. So, you will probably need another way to achieve this.

Copy link
Member Author

@stsewd stsewd Feb 15, 2018

@humitos for the rtd docs django is imported, for the generated conf.py for empty projects it's not, and probably it's ok using plain datetime there, since is just a year and only used for projects without a conf.py file.

Copy link
Member

@humitos humitos left a comment

Take a look at the timezone comment raised by @safwanrahman. Anyway, this PR is too much better that we already have.

docs/conf.py Outdated
@@ -33,7 +36,9 @@

master_doc = 'index'
project = u'Read the Docs'
copyright = u'2010-2017, Read the Docs, Inc & contributors'
copyright = '2010-{}, Read the Docs, Inc & contributors'.format(
datetime.now().year
Copy link
Member

@humitos humitos Feb 15, 2018

I think we don't depends on Django for building the RTD documentation. So, you will probably need another way to achieve this.

@stsewd
Copy link
Member Author

@stsewd stsewd commented Feb 15, 2018

@humitos I update to use django timezone on the rtd docs, for the other template see #3616 (comment)

@@ -10,7 +14,7 @@ source_parsers = {
}
master_doc = 'index'
project = u'{{ project.name }}'
copyright = u'2016'
copyright = str(datetime.now().year)
Copy link
Member Author

@stsewd stsewd Feb 16, 2018

Although, should be better to generate this on template parse time (using {{ some_year }}) rather than build time?

@ericholscher
Copy link
Member

@ericholscher ericholscher commented Feb 16, 2018

I don't think the timezone matters for this simple PR. Let's not overengineer solutions, and try to ship things that are simple.

@ericholscher ericholscher merged commit a79534b into readthedocs:master Feb 16, 2018
1 check passed
@stsewd stsewd deleted the remove-hard-coded-year branch Feb 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants